|
Hi ,
Put ur code of page load I hope this will help u out
if (Page.IsPostBack == false)
{
}
Thanks ,
Amit Patel
|
|
|
|
|
benams wrote: how can I refresh the page and prevent the resending of the info?
Quote Selected Text
By redirecting to a page. When you redirect, browser will clear the post data from it's cache.
|
|
|
|
|
I mean when the user hit the refresh button of his web browser...
|
|
|
|
|
benams wrote: I mean when the user hit the refresh button of his web browser..
You can restrict user to click on Refresh Button on Browser.
The think you need to do is you have to check the Post back of Page.
On Page Load ,
If(Page.ISPostBack)
{
}
And After that Reset All the field.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Please read my last reply in this thread for Answer.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
|
Hi all,
Currently i am in login page(Suppose in window1 ) after validation i m opening new (Window 2)
<
ClientScript.RegisterStartupScript(Me.GetType(), "", String.Format("<script>window.open('UserSetting1.aspx','ReportWindow', 'width=400,height=200,status=no,toolbar=no,menubar=no,location=yes,scrollbars=yes,resizable=no');</script>"))
>
from window 2 user will select hospital name from usersetting1.aspx after this Window 2 will get close and it should go the window1 and instead of login.aspx url should be index.aspx ......
I am doing this using
<
Dim strScript As String
strScript = "<script language=javascript>" & vbCrLf & _
"window.opener.location.reload('index.aspx');window.close();" & _
vbCrLf & "</script>"
If Not ClientScript.IsClientScriptBlockRegistered("") Then
ClientScript.RegisterStartupScript([GetType], "", strScript)
>
This closing window2 and redirecting to the index.aspx in window1 but above code is working fine for Internet explorer but not workng for firefox Please Help to find the solution
Thanks ,
Amit Patel
|
|
|
|
|
Original post is available below and got a reply. Please don't repost.
|
|
|
|
|
I m not reposting sir i m it proper explanation so that u can understand and give answer any way sry please tell me the answer that is not helping me
modified on Tuesday, August 25, 2009 7:37 AM
|
|
|
|
|
Amit Patel1985 wrote: i m it proper explanation so that u can understand
Then You should modify the existing message rather than new post.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hey man sorry from i will keep this thing in mind but please help to find the solution this time......
Firefox is displaying this message.
To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.
thanks ,
Amit Patel
|
|
|
|
|
Amit Patel1985 wrote: hey man sorry from i will keep this thing in mind but please help to find the solution this time......
Its alright Amit.
Amit Patel1985 wrote: Firefox is displaying this message.
To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.
Actually I didn't see your last message. Where is it ? Or you just explain me where is your problem, so that I can help you out.
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
at the top of this post i described my probs.
Thanks
|
|
|
|
|
Well, as I said, install firebug and debug JS. Firebug is an excellent tool and can tell you where exactly is the problem.
|
|
|
|
|
N a v a n e e t h wrote: Firebug is an excellent tool
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hi ,
I am doing this from .vb file so how to debug this.
Thanks ,
Amit
|
|
|
|
|
Hello All,
I am using GridView in my application but not its edit feature due to some reason.
I am editing data manually by writting code.
Problem is when i update data, it is updating in database but its not showing immediately in my GridView.
Can anyone tell me how to reflect changes immediately in GridView.
Thanks,
Nagendra.
|
|
|
|
|
u Call the bind method outside postback or after saving call the bind method
|
|
|
|
|
No, i have used inbuilt SqlDataSource with GridView but just for displaying data.
I am doing editing manually, which don't have any connection with SqlDataSource.
|
|
|
|
|
You need to re-bind the gridview after update. If you are binding the gridview on page_load , ensure you are doing IsPostBack check.
|
|
|
|
|
after updating have u loaded the gird?
once show the code
|
|
|
|
|
just call the bind method after the update precess is done.
|
|
|
|
|
I tried this, but it didn't worked.
|
|
|
|
|
This is my code for GridView and DataSource
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataKeyNames="LocationCode" DataSourceID="SqlDataSource1" OnSelectedIndexChanged="GridView1_SelectedIndexChanged">
<Columns>
<asp:CommandField ShowSelectButton="True" SelectText="Edit" />
<asp:BoundField DataField="LocationCode" HeaderText="Location Code" ReadOnly="True"
SortExpression="LocationCode" />
<asp:BoundField DataField="LocationDesc" HeaderText="Desciption" SortExpression="LocationDesc" />
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="Data Source=COMP2;Initial Catalog=Inventory;User ID=sa;Password=pes"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT [LocationCode], [LocationDesc] FROM [Location_Master] ORDER BY [LocationCode]">
</asp:SqlDataSource>
I am editing data in database manually by using SqlCommand class ExecuteScalar method like this.......
protected void btnSave_Click(object sender, EventArgs e)
{
//This method will update a record into Location_Master table
try
{
string connectionString = ConfigurationManager.AppSettings["ConnectionString"];
SqlConnection connection = new SqlConnection(connectionString);
connection.Open();
string save = "";
//String for updating a record into table
save = "update Location_Master set LocationDesc='" + txtBoxLocDesc.Text + "',CreatedBy='"+Session["userName"].ToString();
save = save + "',LastUpdateDate='" + System.DateTime.Now + "' where LocationCode='"+txtBoxLocCode.Text+"'";
SqlCommand saveCommand = new SqlCommand(save, connection);
int rowsAffected = saveCommand.ExecuteNonQuery(); //Store the no. of rows added or updated
connection.Close();
}
catch (System.Exception ex)
{
lblMessage.Text = ex.Message;
lblMessage.Visible = true;
}
}
After clicking that Save button, database is updating, but changes are not reflecting to GridView, i have to execute my application again to see changes in GridView.
|
|
|
|
|
SORRY for posting so large post, but i can't help it.
|
|
|
|