function KeyCheck(myfield,e) { var keycode; if (window.event) keycode = window.event.keyCode; else if (e) keycode = e.which; else return true; if (((keycode>47) && (keycode<58) ) || (keycode==8)) { return true; } else return false; } You can use this function for keypress so that it will not allow u to put any characters but only numeric. If you have a HTML control then call this function by onkeypress="return KeyCheck(this,event);" Else on server side code write TxtPhone.Attributes.Add("onkeypress","return KeyCheck(this,event)"); Vicky "Walking on water and developing Software on a specification is easy, if both are frozen..."
Vicky Roberts
Posts
-
Validation on Telephone No. in javascript -
to merge dynamically..Please read my reply to ur message regaring adding image 2 into Image 1 that can help you to solve this issue also. "Walking on water and developing Software on a specification is easy, if both are frozen..."
-
how to merge images dynamically(asp.net'c#)Check the following code In this example Image2 will be added to the Image1, you need to just change the names from Images1.gif and Image2.gif to your image name. Let me know if you have any issues. //Code Starts Here // This is the Original Image that is Image1 System.Drawing.Image bgimage = System.Drawing.Image.FromFile(Server.MapPath("Image1.gif")); Bitmap bmp = new Bitmap(1, 1); Graphics graphic = System.Drawing.Graphics.FromImage(bmp); // measure the image int height = bgimage.Height; int width = bgimage.Width; // recreate our bmp and graphic objects with the new measurements bmp = new Bitmap(width, height); graphic = System.Drawing.Graphics.FromImage(bmp); graphic.DrawImage(bgimage, 0, 0, width, height); graphic.TextRenderingHint = TextRenderingHint.SystemDefault; System.Drawing.Image bgimageNew = System.Drawing.Image.FromFile(Server.MapPath("Image2.jpg")); //You can set x position, y position, width and height of the second image. graphic.DrawImage(bgimageNew,5,5,50,15); // Set the content type and return the image Response.ContentType = "image/JPEG"; bmp.Save(Response.OutputStream, ImageFormat.Jpeg); // dispose of our objects bgimage.Dispose(); graphic.Dispose(); bmp.Dispose(); //Code Ends Here Vicky "Walking on water and developing Software on a specification is easy, if both are frozen..."
-
How do i display Db data in labels ?Yes you can do that check the following code. Hope this will solve your problem. "Walking on water and developing Software on a specification is easy, if both are frozen..."
-
image handlingYou can create another apx page and in the page load of this new aspx you can write this. byte[] image = null; image =(byte[])objDV[0]["imgImage1"];// Taking it from dataview/dataset/dtable Response.ContentType = objDV[0]["strImage1ContentType"].ToString(); Response.BinaryWrite(image); Assume this new aspx page name is ImageLoad.aspx In your page where you are taking an Image control, call the method from aspx page. and in code behind you will have protected string GetLogoURL(object objLogo) { return "ImgLoad.aspx" } Let me know if this worked for you.
"Walking on water and developing Software on a specification is easy, if both are frozen..."
-
accessing client side source from server sideHello... You can put a
and make the
runat=server and put all your client code in that
. Eg :-
Help Out
In code behind adding this TbMain.InnerText.ToString() You will get the complete table block from the
i.e
Help Out
Let me knw, if you r looking for something else will try to help you out.
"Walking on water and developing Software on a specification is easy, if both are frozen..."
-
Finding Printer Status in ASP.NET 1.1Hi... Please go through the following link.... http://www.codeproject.com/csharp/printeroffline.asp
"Walking on water and developing Software on a specification is easy, if both are frozen..."
-
Hiearchial representation in GridYou can do it in TreeView control with the same look and with proper js. You can also do it in datagrid but will have some limitations. Let me know so accordingly I can give you the code.
"Walking on water and developing Software on a specification is easy, if both are frozen..."
-
Populating ImageBox from datasetYou can create another apx page and in the page load of this new aspx you can write this. byte[] image = null; image =(byte[])objDV[0]["imgImage1"];// Taking it from dataview/dataset/dtable Response.ContentType = objDV[0]["strImage1ContentType"].ToString(); Response.BinaryWrite(image); Assume this new aspx page name is ImageLoad.aspx In your page where you are taking an Image control, call the method from aspx page. and in code behind you will have protected string GetLogoURL(object objLogo) { return "ImgLoad.aspx" } "Walking on water and developing Software on a specification is easy, if both are frozen..." -- modified at 4:31 Tuesday 19th September, 2006