TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aniruddh Kewat
NA
30
20.7k
how _doPostback works ?
Jun 14 2015 10:03 PM
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
<script type="text/javascript">
function SaveWithParameter(parameter) {
__doPostBack('btnSave', parameter)
}
</script>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="btnSave" runat="server" Text="click me" OnClientClick="SaveWithParameter('Hello Michael')" />
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label><br /> <br />
</form>
</body>
</html>
code behind
protected void Page_Load(object sender, EventArgs e)
{
if(Page.IsPostBack)
{
string eventtarget = Request["_EVENTTARGET"]; // parameter
string eventargument = Request["_EVENTARGUMENT"];
// Request["__EVENTTARGET"]; // btnSave
Label1.Text = "EVENTTARGET : " + eventtarget + "EVENTARGUMENT : " + eventargument;
}
}
Reply
Answers (
4
)
how to use command argument of linkbutton in jquery ?
Why .toggle() working in jquery -1.8.js and not in upcoming