|
hello
i am binding dropdownlist through coding but when i change any value of it and click on save it will be reset and donot have that values which i fill it in it.
what is reason behind it?
if anyone knows then plz help
|
|
|
|
|
deepalititi wrote: what is reason behind it?
1 - Viewstate might be turned off
2 - You might be binding dropdown list in the page_load without checking !IsPostBack
|
|
|
|
|
|
Hi There,
well cannot exactly make out your problem,
But looks like your dropdownlist is not inside if(!IsPostback){}
The simple thing that appears here is it is getting binded again.
Hope it helps,
Cheers
Menon
|
|
|
|
|
Hi All,
I have a grid that I bind to a SQLDataSource. The grid I set to AutoGenerateColumns="false" and then I specify the columns myself.
The thing is that one of the columns has a Id, and the user shouldn't be able to edit that, but if I set the column to ReadOnly="true" then it doesn't update the other values, but if I set the ReadOnly="false" then it updates.
How can I get passed this because the Id is there only for reference and shouldn't be updated by the user.
Thanks in advance
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Is that Id columns also template ? Try making it as a normal bound column.
|
|
|
|
|
it is as follow:
<Columns>
<asp:BoundField ReadOnly="false" HeaderText="ID" DataField="websiteid" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Name" DataField="websitename" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="URL" DataField="weburl" NullDisplayText="N/A" />
</Columns>
So the first column is the one that shouldn't be edited, but if I change ReadOnly="true" then it doesn't update the rest of the values
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
NeroToxic wrote: but if I change ReadOnly="true" then it doesn't update the rest of the values
Are you using inbuilt edit/update buttons ? Can you show me the code used for updating ? Since you are using all normal bound fields, how edit textbox will come when you press edit button ?
|
|
|
|
|
I set the update on the GridView itself.
<asp:GridView ID="gdWebsites" runat="server" AllowPaging="True" AllowSorting="True" DataSourceID="SqlDataSource1" AutoGenerateEditButton="true" OnRowUpdated="gdWebsites_RowUpdated" AutoGenerateColumns="false">
The thing is that the previous code I posted works and updates the values, but once I change it as follow :
<Columns>
<asp:BoundField ReadOnly="true" HeaderText="ID" DataField="websiteid" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="Name" DataField="websitename" NullDisplayText="N/A" />
<asp:BoundField ReadOnly="false" HeaderText="URL" DataField="weburl" NullDisplayText="N/A" />
</Columns>
it gives me the text boxes to change, but once I click update no changes are made
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Sorry, I don't have much idea on this
|
|
|
|
|
No Problem, thanks for the help
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Just thought I'd let you know I have solved the problem,
In the gridview I needed to add the ID field in the DataKeyNames
No matter how long he who laughs last laughs, he who laughs first has a head start!
|
|
|
|
|
Hi,
In my asp.net application when we start debug the following error is occured - "unable to start debugging on web server. the underlying connection was closed: An Unexpected error on send"
Regards
SMK
|
|
|
|
|
Hi There
The chances of this happening is to you is, You create an ASP.NET Web application by using localhost as the Web server, and you change the Web site setting in Microsoft Internet Information Services (IIS) to use the specific IP address for Web Site Identification. Then, when you run the application, you receive the following error message
Please try a search on google for this. You have to open your WebApp.csproj.webinfo file(c#) and modify the localhost and give you IP address. And further few steps. This you may apply for the case above.
I am not providing you complete solution because its pretty much there on google. Please try searching and you will easily find the solution. If still not. Please write back.
Thanks
Cheers
Menon
|
|
|
|
|
i made a profile page in my application and now i want that user can load his picture with all other information
please help me out how do i store / load picture in database along with all other information of the user
waiting for replies as soon as possible
regards 2 all
kanza
|
|
|
|
|
1.Insert a User into the Database and get the RecordId of that user
2.Than after save your photo into the Folder by record id name
FileUpload.SaveAs(Server.MapPath("Photo/") + RecordId + System.IO.Path.GetExtension(FileUpload.PostedFile.FileName));
3.Update Database Filed Photo By the RecordId.jpg
Photo = +RecordId + System.IO.Path.GetExtension(FileUpload.PostedFile.FileName);
Umesh
|
|
|
|
|
|
Go to ajax web site and watch video tutorials
|
|
|
|
|
Gagan Deep Garg wrote: how implement ajax.net.
How to search in google[^] ?
|
|
|
|
|
first u download ajax form net and install on ur system ofter that u ask me what next process.
Piyush Vardhan Singh
|
|
|
|
|
hi
please help me.....
am doing a mantanence project. i have writen some code to copy a file from server to harddisk. but there is some problem. i have developed this as windows application. now they want as web. tyhe problem is, i was reading the file path and copying in dos.in windos the path is already is there in html page in javascript. can i move the value to a the code behind string(C#). if we can convert how is it possible?
in code behind there is string Customer, book
on html page there is values of customer1 and journal as
var customer1 ='<%=Session["customer"]%>';
var journal = '<%=Session["journal"]%>';
how can we get the values of customer1 and journal to Customer, book
please help me....
please
|
|
|
|
|
P_Elza wrote: how can we get the values of customer1 and journal to Customer, book
Put these values into a hidden server textbox control. Access the values from there in server side. Make sure you are not storing any sensitive information as it is easy to tamper.
|
|
|
|
|
You Can create two hidden variables with tag runat="server" and assign the values to these hidden fields and access it from server side.
|
|
|
|
|
i have one master page, in this body we have written onkeydown event in javascript. in this javascript code we are preventing for Enter button keycode. this javascript function is preventing enterbutton for my whole application
in my default.aspx form, there is one contentplaceholder, in which there is textbox(multiline) control.
my problem is i want to activate/allow enter button onkeydown event only for my default.aspx textbox control.
How can i do this. ??
Ramana
|
|
|
|
|
Try this
function isValidText(oSrc, args)
{
}
Just Check it.
I guess in ur case oSrc.ClientID will give u desired thing. ClientID is a distinguisable feature in case of multiline control which is appended by rownumber in ID.
|
|
|
|