开发者

Manuell Postback in ASP.Net

how I can do a manuell开发者_运维技巧 postback in the code?

I don't want a Redirect, because e.g. the user has entered values in fields in the site and decide than to login. I only want a simple Postback.


If you have link/image buttons on you page you can do:

__doPostBack('link/image button name',''); // in javascript

or if not:

var f = document.forms[0]; //if you only have one forms(this standard on asp.net)
f.__EVENTTARGET = 'some control name';
f.submit();


What's your point? Do you want to generate a postback script?

Page.ClientScript.GetPostBackEventReference(this, "Arguments", false);

Afterward, for handling the postback you must implement the System.Web.UI.IPostbackEventHandler.

But if you want a cross postback, check it out:

http://www.c-sharpcorner.com/UploadFile/DipalChoksi/xpgpostbk_asp2_dc08102006235543PM/xpgpostbk_asp2_dc.aspx

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜