//Function to get the HTML name of the server control from the Client Id
// Parameters:
// clientId – Control.ClientId
// serverId – Control.id
private string GetHTMLNameById(string clientId, string serverId)
{
int pos = serverId.IndexOf(‘_’);
string HTMLName = “”;
if(pos >= 0)
{
pos [...]
The first is a definition of the separate function leftTrim, rightTrim and trimAll.
These trim the spaces to the left of the string, the right of the string and both sides respectively.
function leftTrim(sString)
{
while (sString.substring(0,1) == ‘ ‘)
{
sString = sString.substring(1, sString.length);
}
[...]
Actually these are not exactly ‘true’ random numbers. These are actually pseudo-random numbers, which means that they give you an illusion that they’re being generated randomly.
It’s very simple: There’s a class called System.Random. and the rest is as simple as this:-
Random r = new Random(0);
int num = r.Next(0,999999);
in VB .NET
dim r as Random = new [...]
Ever wonder how you could put in the functionality of downloading a file when the user clicks the button? Well here’s how I did it. The technique is to send the file to the browser via response and put the content type to application/pdf. Without putting in any further delays, here’s the code.
/// <summary>
/// opens [...]
well today I was just putting in a pop up window in my application using the Javascript’s window.open method and at first I wrote this:
window.open(“printApp.aspx”,“Print barcode window”,”status=0,width=380,height=175,location=0,scrollbars=0,resizable=0″);
and that was working in Firefox but when I fired up IE to see whats happening there it was giving an invalid parameter’s error. So I started trimming the [...]
well, it was just yesterday that I was looking into converting html to pdf programmatically in .NET 2.0. After some googling, I came up to the iTextSharp library at SourceForge.
Just built an application to test run this iTextSharp library. so here’s the code for the “Hello world” application.
private void HelloWorldPdf()
{
try
{
iTextSharp.text.Document oDoc = new iTextSharp.text.Document();
PdfWriter.GetInstance(oDoc, new [...]
howdy every one,
ah, well, feeling very sleepy right now and I’m just sittin here at my desk upgrading my VS .NET to SP 1. Just heard from my colleague that hey! just one blog in whole September? Just got a deadline tommorow and well here I am sitting with this dumb thing taking so much [...]
Over the past few years I’ve been trying intentionally to actually pursue a state of mind called happiness. Moments ago it just occurred to me that happiness is only a way you feel about somethings in life, you feel happy when you have certain criterion fulfilled in your life; but what if you change you’re [...]