我的问题是,在网页上任何纽芬兰人点击事件之前,这页的火力。 如果我想回到同一页,并在问询中转交一些数据,那么,就在第1页。 Load读到该数据和人口网格,视盘点的价值而定(细节.aspx =>细节.aspx?id=2)。
我如何能够这样做? 谢谢!
我的问题是,在网页上任何纽芬兰人点击事件之前,这页的火力。 如果我想回到同一页,并在问询中转交一些数据,那么,就在第1页。 Load读到该数据和人口网格,视盘点的价值而定(细节.aspx =>细节.aspx?id=2)。
我如何能够这样做? 谢谢!
private void Page_Load()
{
if (IsPostBack)
{
// DO what you need to do from the postback here.
}
}
最新资料:
if you use are redirecting to the page it is no longer a postback (Response.Redirect). In that case the option I see is in page_load you check for a specific querystring parameter and act on it.
if(!String.IsNullOrEmpty(Convert.ToString(Request.QueryString["myQueryParam"])))
{
}
The Request.Form.Keys
collection contains the button id that caused the postback.
In effect you can use this to detect the button that was clicked.
Alternatively use ASP hyperlink control and put the querystring url into the NavgateUrl property. (unless you have more postback data required from the details page)
如果你正在做数据,对这样的工作具有约束性,那么你就会工作。
<asp:HyperLink ID=”linkTest1” runat=”server” NavigateUrl= <%# Eval(“ColumnName”, “Details.aspx?ID={0}”) %>
Or you can set the ID from code behind like ths
linkTest.NavigateUrl = "Details.aspx?ID=" + IdVariable;
This would be better than doing the response.redirect
他似乎只是简单地问他如何用问话向同一页。 我感到惊讶的是,为什么没有人提到:
void Page_Load( ... )
{
if (!Page.IsPostBack)
{
Response.Redirect("Details.aspx?id=2");
}
}
当然,根据你的解释,我只字不提URL。 你们能够以方案方式确定这种ur和 que。
希望有助于其他人。
In my webpages I have references to js and images as such: "../../Content/Images/"Filename" In my code if I reference a file as above, it doesnt work so i have to write: "c:/miscfiles/"filename" 1-...
I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...
Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...
I m looking for best practices here. Sorry. I know it s subjective, but there are a lot of smart people here, so there ought to be some "very good" ways of doing this. I have a custom object called ...
I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...
i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...
For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?
I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!