|
Hi, I m working with asp.net 2.0. I set the GridView.DataKeys as ID. When I click on Update button. the updating event is raised. But in the e.Keys/NewValues/OldValues there is always 0. But I get the rowindex of hte row i edited.
I think i didn't set any property of gridview. thats why i don't get value in e.NewValues Property
Please help
|
|
|
|
|
Since I don't see your sample code, so IMO you may want to check a couple of properties:
+ The DataKeyNames property of the GridView control.
+ Do you use the BoundField or TemplateField with the data binding expression in the GridView control? If you use the expression, make sure it support two-way data binding.
+ Do you any datasource control with the GridControl? If yes, check the ConflictDetection property.
You can see more details in MSDN[^]
|
|
|
|
|
My problem was i didn't attached an objectdatasource to the gridview. I was only getting RowIndex in the RowUpdating event.
As i was not able to get the newValues,oldValues/Keys, I attached an objectdatasource(which is attached .dll file) to the gridview control. Now when i click on update link on the gridview, I get the newValues,oldValues/Keys.
If i want to get access to newValues,oldValues/Keys in a RowUpdating event of a gridview/detailsview, do i have to always assign an objectdatasource.
|
|
|
|
|
sohne wrote: If i want to get access to newValues,oldValues/Keys in a RowUpdating event of a gridview/detailsview, do i have to always assign an objectdatasource.
Yes, you do. If you don't specify the datasource in the DataSourceID property of the control, you only have the row index value in the event data argument GridViewUpdateEventArgs .
|
|
|
|
|
Hi
I'm using a asp.net web based application builder (ework) that provides an interface to write jscript.net static functions. (shared)
In the function, I am calling a web service via a proxy created in visual studio. I have set the URI in the proxy to be dynamic which has created an app.config file. All this is working in dev.
Now that I'm moving to test, I've copied the App.config to the directory with the Web sevice proxy dll (CIServiceProxy.dll) and renamed the file to CIServiceProxy.dll.config however, it is not picking up the revised uri for the web service.
Is this because the process is running within a web application? or the functions called are Static or I've done something silly.
Is there an alternative way of making the webservice uri dynamic?
cheers
G Field
|
|
|
|
|
When you use the library as a part of the web application it doesn't have any config file of it's own, but uses the web.config of the web application.
---
b { font-weight: normal; }
|
|
|
|
|
For example.
The a.aspx is on my website, the value of the hidden form named "business" was evaluated in codebehind .cs file.
a.aspx
---------
loading.submit();
Somone who browse a.aspx can see the value of the hidden form via source in IE temporary files folder.
How to protect the value of the hidden form by preventing people see it's value?
Thanks.
|
|
|
|
|
Could you use viewstate instead?
|
|
|
|
|
Hi there,
If you don't want the user to view the hidden value, you should not write it to the page. Instead, you can use the HttpWebRequest[^] to post data to the destination site.
|
|
|
|
|
Right. You can choose it to be a "Post" request to be on a safer side.
If you remember there was similar scenario for Primitive ASP using XHTTP. ASP.NET makes it much easier to make server side web requests using the HttpWebRequest, etc objects.
Best Regards,
Darpan Gogia
|
|
|
|
|
I have found kind of discussion about this.
http://www.dotnet247.com/247reference/msgs/22/111861.aspx[^]
There remain one question:
Now i can post the form data to page in another site(http://other.com/a.asp) by HttpWebRequest,
but the browser doesn't redirect to the target page.
How to post data and redirect to the target page at the same time?
|
|
|
|
|
+ Post data with the HttpWebRequest object
+ Access the HttpWebResponse object using the GetResponse method
+ Read the output result from the above HttpWebReponse object.
+ Send the output result to the client side through the current Response object.
|
|
|
|
|
Following this 4 steps,
the program just only print the result from target page to browser,
but the browser of IE doesn't rediect to the target page.
Is there any mechanism to post the data to the target page in another website,
and then, IE redirect to the target page?
|
|
|
|
|
|
Hi all,
I wonder could ASP.NET 1.0 and ASP.NET 2.0 run on the same Windows?
When I install .NET 2005, all ASP.NET 1.0 website can't run with message "Server Application Unavailable". But I run ASP.NET 2.0 website OK.
How to run both ASP.NET 1.0 and 2.0? (not convert ASP.NET 1.0 to ASP.NET 2.0)
Please help me!!!
Thanks,
Thai Nam
|
|
|
|
|
In the properties for the web application in IIS, you can choose what version of the framework the application uses.
---
b { font-weight: normal; }
|
|
|
|
|
Yes, I changed version of framework ASP.NET 1.0 web uses, but they can't run on both 1.0 and 2.0.
|
|
|
|
|
i have a dropdownlist and a textbox:
i want when i select dropdownlist textbox be enable and when i dont select that be disabled.
|
|
|
|
|
For your textbox in the code behind:
myDropDownList.Attributes.Add("onclick", "EnableTextBox;");
In javascript on the page:
function EnableTextBox()
{
document.forms[0].myTextBox.disabled = false;
}
|
|
|
|
|
Hi all. How can i validate a date in format of DD/MM/YYYY using regularexpressionvalidator control? please help me out.
|
|
|
|
|
Use this pattern: "\d{2}/\d{2}/\d{4}".
This will of course only verify that the format is correct, it can't verify that the date actually exists. You can make the verification a bit better by making sure that the date is in the range 1 to 31 and so on, but still that won't see that a date like 31/02/2006 does not exist.
---
b { font-weight: normal; }
|
|
|
|
|
You can use the CompareValidator with the DataTypeCheck operator and Type="Date" to validate if the textbox value is a valid date. You also should remember that the date format used by the validator is specified based on the current culture value when the validator control renders, for example if the current culture is set for the "en-GB" value, then the dateorder will be mdy , and the validator will accept the values like 18/4/2006 or 18/04/2006 ..., the delimiter can be either - or / . If you want to use the fixed format like you said, you can either implement a custom validator for this or use an additional RegularExpressionValidator with the pattern suggested by Guffa. For more information on how to set the culture value, you can see MSDN[^]
|
|
|
|
|
Use Compare Validator that would be correct solution in this scenario
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
I am using an evaluation period tool named as SoftArtisan Office Writer.
I hav got an error while using one of the feature in my code that is
Invalid license key: format is out of range. : (SoftArtisans.ExcelWriter [ Invalid license key: format is out of range. ] 6.5.4.0430 (03282006-111331-ACHILLES))
It comes after adding this code
ExcelApplication xla = new ExcelApplication();
xla.Create();
it allows me to create ExcelApplication obj but while i Create application that is using xla.Create() it generates the above error.
Can anybody suggest me its giving me such error just becoz i m using evaluation period software and it disabled few facilities or something else
waiting for reply
thanx
Saima
|
|
|
|
|
Hi there,
IMHO, you might want to check out their support[^] site.
|
|
|
|