|
THANK U FOR UR HELP
I GOT THE RESULT
REGARDS
VENKAT
venkat
|
|
|
|
|
Hi,
I have a user control in which I have a save button.
When this button is clicked data will be saved to the database.
After button clicking if I refresh the page, then the same button click event is called again which is adding the data again in the database.
I tried all possibilities i found, but didnt able to get the solution.
Could anyone please let me know the solution for this.
Thanks,
Madhuri.
Madhuri
|
|
|
|
|
The problem is that a refresh does the postback again. The solution is to redirect your page in your button click event after saving. If your page has some state it needs to show, then pass a variable on the URL that reloads that state. Then, a refresh reloads the page with the variable, and shows the state, but does not execute the save event.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have 3 drop downlist boxes upon whose selection a new record adding section will be displayed.
But If I redirect the page, the dropdownlistboxes values will be reset, which is not expected.
|
|
|
|
|
Well, unless you put the selections in the URL, they will obviously reset. You can't have it both ways. All state will be held in viewstate, or all state needs to be on the URL ( or in the session, but that should be avoided ).
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi There,
I believe you dont want the button Click to be called again.
I am not sure the solution will work or not, but try this,
Javascript
function DisableButton(buttonElem) {
buttonElem.value = 'Please Wait...';
buttonElem.disabled = true;
}
ASPX
<asp:button id="btnSubmit" runat="server" Text="Submit" />
C#
protected void Page_Load(object sender, EventArgs e)
{
btnSubmit.Attributes.Add("onclick", "DisableButton(this);" +
Page.ClientScript.GetPostBackEventReference(this,
btnSubmit.ID.ToString()));
}
I got this solution from the website itself.
I hope it works for you....
Thanks
Cheers
Menon
|
|
|
|
|
I don't think this will work. It stops a postback from clicking more than once, but not from a refresh.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I published my project to another virtual directory on my PC then run it and thrown an error ,but it works fine when i compile an run it in VS.NET 2005.
The error is...
<br />
Parser Error <br />
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. <br />
<br />
Parser Error Message: Ambiguous match found.<br />
<br />
Source Error: <br />
<br />
Line 1: <%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_eid71yai" %><br />
Line 2: <br />
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><br />
<br />
<br />
Source File: /TestSmartSync/index.aspx Line: 1 <br />
Could anyone help me what is Ambiguous match found.?
Why does it work properly in VS.NET but doesn't work when it was published?
Thank for help =)
|
|
|
|
|
Have you perhaps copied the site up twice, windows has named one set 'copy of', or one set is in a subfolder, so it's finding two cs files that define the same class, and that's what's ambiguous ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi i have one msaccess database...,
In that i have given password to that mdb file...,
Before given password its bind the data in my form grid...
after given password its giving error as : Not a valid password
How to give that password in my codes?
Regards,
Magi
|
|
|
|
|
Provider="Provide Name" ;Data Source=C:\mydb.accdb;Jet OLEDB:Database Password=password;
Could u kindly try this using ur Connection String !!!
and it will work for you
Happy Programming
-----
Abhijit
|
|
|
|
|
|
you can set password in your connection string like
dbconn=New OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;
data source=" & server.mappath("northwind.mdb"); password = "Password")
Girish Soni
|
|
|
|
|
Hi girish idf u give only password it wont work..,
Before that have to give that Jet OLEDB:database
Anyway thansk for reply
Regards,
Magi
|
|
|
|
|
Hello friends, My project page displays this error..Can any one help me?
Server Error in '/' Application.
Configuration Error
Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.
Parser Error Message: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
Source Error:
Line 17:
Line 18: <system.web>
Line 19: <trust level="Medium" originurl="http://.*" processrequestinapplicationtrust="true">Line 20: <pages enableeventvalidation="false" viewstateencryptionmode="Never">
Line 21: <customerrors mode="Off">
Source File: \\smb0\mnt\w0711\d07\s14\b02c4bf2\www\watergenie.ca\test\web.config Line: 19
Show Additional Configuration Errors:
This configuration section cannot be used at this path. This happens when the site administrator has locked access to this section using from an inherited configuration file. (\\smb0\mnt\w0711\d07\s14\b02c4bf2\www\watergenie.ca\test\web.config line 19)
Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.210
|
|
|
|
|
Hi all,
i have the stranges problem. I have this website running in a cms that i made myself.
In the administration the adminuser can save settings that are writen and saved to the web.config file. And all of this have been working fine .... until now.
Now when the user tryes to save changes, the browser prompt the user for login credentials again. Does any of you have any idea why this is? I am pretty sure that i havent made any changes to generate this problem.
I am totally lost here ... so hope that you can help?
Christian
|
|
|
|
|
Hi,
I am creating dynamic text box on placeholder on a button's click event.how I can get value entered in textbox
-- modified at 4:49 Friday 5th October, 2007
Girish Soni
|
|
|
|
|
You are creating dynamic textbox control on button click event but on which controls event you want to get value of textbox
First you have to create this textbox on every postpack otherwise you can't get value of textbox.
bEST rEGARD
pATHAN
please don't forget to vote on the post that helped you.
|
|
|
|
|
Pls guide me how I can crate this text box on every postback event?
presently I have created a function create textbox and I am calling this on a button's click event.
Girish Soni
|
|
|
|
|
I am giving you one sample code.
try this and see how to create dynamic control and how to use it.
protected void Page_Load(object sender, EventArgs e)
{
TextBox txt = new TextBox();
txt.ID = "myTxt";
PlaceHolder1.Controls.Add(txt);
}
protected void Button2_Click(object sender, EventArgs e)
{
Response.Write(((TextBox)this.PlaceHolder1.FindControl("myTxt")).Text);
}
bEST rEGARD
pATHAN
please don't forget to vote on the post that helped you.
|
|
|
|
|
Pls guide me how can crate this text box on every postback event?
presently I have created a function create textbox and I am calling this on a button's click event.
Girish Soni
|
|
|
|
|
You'd have to overload LoadViewState and SaveViewState, and work out what textboxes you need to create in there, I reckon.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
The click event is too late. On postback, it needs to be recreated prior to the page load. Or, you can have a hidden field on your form and write javascript to store the text of your textboxes, perhaps as xml, within that field.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i want the entries for the date time format type in the followig manner
12-Oct-2007.
i was trying to change the type using the user defined functions in sql server 2000.
can somebody please help how to do it?
Soniagupta1@yahoo.co.in
Yahoo Messenger Id = soniagupta1
|
|
|
|
|
Sonia Gupta wrote: i want the entries for the date time format type in the followig manner
12-Oct-2007.
I thing not possible
but you can get in asp.net in this format
bEST rEGARD
pATHAN
please don't forget to vote on the post that helped you.
|
|
|
|