Skip to main content

Posts

Showing posts from June, 2009

Calling JavaScript in ASP.NET

<html xmlns="http://www.w3.org/1999/xhtml" > <head id="Head1" runat="server"> <title>Untitled Page</title> <script type="text/javascript"> ShowValue = function() { document.getElementById("TextBox1").value="erert"; } </script> </head> <body> <form id="form1" runat="server"> <div> <asp:TextBox ID=" TextBox1 " runat="server" Text="2"></asp:TextBox> </div> <textarea rows="10" cols="30" </form> </body> </html> --------------------------- In Code Behind---------------------------------- protected override void OnInit(EventArgs e) { Page.ClientScript.RegisterStartupScript(Type.GetType("System.String"), "addScript", "ShowValue()", true); } you can also call the java

Access Text Box in ASP using Java Script

Access Java Script using ASP.NET  Assume that you have a java script file callled sample.js in the file function display() {      var TextBox = document.getElementById( " TxtID " );     TextBox.value = "Hello"; } In the Aspx Page protected void Page_Load(object sender, EventArgs e)         {                        ClientScriptManager script = Page.ClientScript;             if (!script.IsClientScriptIncludeRegistered("ScriptInFile"))             {                 script.RegisterClientScriptInclude("ScriptInFile", " sample.js ");             }        } Assume you want to call the function on the onload event , then in the body tag used Onload=display() Note:- Sometime this may not be worked. because the problem of the text box id. ASP generete ID for text box. then what you have to do is run the aspx page ones and get the text box id using view sourse. then replace  TxtID that.

Mobile Splash Screen

Set Mobile Form to Center Sreen int x = (Screen.PrimaryScreen.Bounds.Width - frmSplash.Width) / 2; int y = (Screen.PrimaryScreen.Bounds.Height - frmSplash.Height) / 2; frmSplash.Location = new System.Drawing.Point(x, y);

Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object

Logon failed. Details: crdb_adoplus : Object reference not set to an instance of an object. Error in File C:\DOCUME~1\JASONML\ASPNET\LOCALS~1\Temp\ReleasedDrawings {AA4B9DD0-25C5-40B9-9847-74F743ADEAED}.rpt: Unable to connect: incorrect log on parameters. This error occurs because of error error in used dataset. Recreate the dataset will solve the problem.