|
not sure what was going wrong but re-created the grid view and binding was succesfull
GridView is displayed as expected
Thanks
Colin
|
|
|
|
|
Hi
I am trying to print 2 substrings of a textbox but i get this error
MY CODE IS :
---------------
If Not TextBox1.Text = "" Then
str = TextBox1.Text.Substring(0, 3)
str1 = TextBox1.Text.Substring(3, TextBox1.Text.Length - 1)
End If
But it is giving error
-----------------------
Index and length must refer to a location within the string. Parameter name: length
Help me
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
If you look at the definition of the Substring method you will see thatthe second parameter is the length you want...not the end position.
You are trying to read from position 3 to (length-1) which will always be past the end of the string.
If you want to read everything until the end, there is an overriden version of substring method that just takes the start position.
|
|
|
|
|
Sorry i didnt get u r point sir...
How can i print that 2 values
or
any other idea to substring
thx for replying
asdfasdfasdfasdfasdfasdfasdfasdfasdfasdf
|
|
|
|
|
If you read the documentation on Substring[^] you will see that there are 2 versions of it. One takes start position and length, the other just takes start position[^], For your str2 you want the latter. which will give you everything from start position onwards.
Also, please do not to use txtspk in these forums.
|
|
|
|
|
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.
|
|
|
|