•  First of all open visual studio and create a web application

•  On the

•  Run the application.

•  You can see a button which have added in the web form at design time.

•  Right click on the web browser.

•  Click





•  Now add a textbox in the form.



•  Right click on the browser window and click





•  Now add an attribute

•  Again run the application.

•  Click on the textbox and type something in it. You can observe the submission of page validates

•  Now again right click on the browser and click











•  On the head section of the page add a JavaScript function


<script language="javascript" type="text/javascript">
    function ClickButton() {

        return false; 
    }
</script>



•  On the page load add the following code


Button1.Attributes.Add("onclick", "return ClickButton();");



•  Run the application



•  Now in the •  method add following


_doPostBack("TextBox1", "Test");






<script language="javascript" type="text/javascript">
    function ClickButton() {            
        _doPostBack("TextBox1", "Test");
        return false; 
    }
</script>



•  Now again run the application.

•  Click on the button.






Posted By  -  Karan Gupta
 
Posted On  -  Friday, May 21, 2010

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250