how to add cliet side event to server side?
and
how to register client script to sever side? wt difference
these two
Answers were Sorted based on User's Feedback
Answer / yogesh sharma
ClientScript.RegisterStartupScript(Me.GetType
(), "script", "<script language=""javascript"">function1(){}
</script>")
and
ClientScript.RegisterClientScriptBlock(Me.GetType
(),"script","<script language='javascript'>function1(){}
</script>
above two methods use to add client side event to server
side.
Difference between above two is that
ClientScript.RegisterStartupScript will insert script
before closing </form> tag.
and
ClientScript.RegisterClientScriptBlock will insert script
after form start tag <form runat=server > of the page.
Is This Answer Correct ? | 2 Yes | 0 No |
Answer / jagadish
string popupScript = "<script language='javascript'>" +
"window.open'PopUp.aspx', 'CustomPopUp', " +"'width=200,
height=200, menubar=yes, resizable=no')" +"</script>";
Page.RegisterStartupScript("PopupScript", popupScript);
OR
Page.RegisterStartupScript(me.gettype(),"somename","<script
language=javascript>somefunction()</script");
Is This Answer Correct ? | 1 Yes | 0 No |
Answer / raju
we can register client script in serverside also....if u
want to make it in serverside use this code...
ClientScript.RegisterStartupScript(Me.GetType
(), "script", "<script language=""javascript"">function1()
</script>")
(or)
Me.Page.RegisterClientScriptBlock("close", "<script
language=javascript>javascriptcode......</script>")
I think there is no difference b/n those two....depending
upon the situatio we can use any of these....
Is This Answer Correct ? | 0 Yes | 0 No |
What is State Management in .Net and how many ways are there to maintain a state in .Net?
What is a page life cycle?
Take one textbox if I am inputting abc alphabet in capital letter or in small letter on the button click it will be bcd or if I enter 123 and it would be 234 like that in ASP.NET?
how we declare interface
Name two properties common in every validation control?
With example & diagram explain AutoPostBack.
What is a 401 redirect?
How do you make your site SSL enabled ?
How to check null values in dataset ?
What is X-Path?
What is the difference between a cookie and a pixel?
What is inproc mode in session?