|
Anyone know alot about them? I am fed up with the information being displayed as one long row that stretches away off the screen. Is there a way of making it 2 columns or even three but with the same data in it obviously.
Cheers
|
|
|
|
|
You could use TemplateColumns and put two, three, four (more?) fields worth of data in the same column.
|
|
|
|
|
Hopefully somebody can help with this or at least tell me it is possible
I have a VS 2005 project, the default page has a menu control, a multiview control and several views within this. When i click the menu item i use a case statement to make different views active, as shown;
protected void mnuMain_MenuItemClick(object sender, MenuEventArgs e)<br />
{<br />
string strMenu = "";<br />
strMenu = mnuMain.SelectedValue.ToString();<br />
<br />
try<br />
{<br />
switch (strMenu)<br />
{<br />
case "Home":<br />
MultiView1.SetActiveView(viewHome);<br />
break;<br />
<br />
case "Submit":<br />
MultiView1.SetActiveView(viewSubmit);<br />
break;<br />
<br />
case "System":<br />
ds = dba.ReturnDataSet("select * from system_status");<br />
grdSystem.DataSource = ds; grdSystem.DataBind();<br />
MultiView1.SetActiveView(viewSystem);<br />
break;<br />
<br />
default:<br />
MultiView1.SetActiveView(viewHome);<br />
break;<br />
}<br />
}<br />
catch (Exception exp)<br />
{<br />
string exception = exp.ToString().Replace("\n", "");<br />
Response.Redirect("error.aspx?error=" + exception);<br />
}<br />
}
When the user clicks the menu item 'System' i want to connect to a database using a class i created called dba and the function ReturnDataSet. I then want to bind this to a gridview control called grdSystem, which is located in the View control 'System' and make this View the active view.
This code complies and runs with no errors and the dataset has the correct number of rows returned.
But the gridview inside the View is not displayed and on walking through the gridview has no items in it. (I tested with a gridView which was not inside a view and the contents as displayed ok so i think it is something to do with refreshing the view control??)
Hopefully this makes sense and somebody can tell me if this is possible?
Thanks
Colin
-- modified at 7:19 Tuesday 18th April, 2006
|
|
|
|
|
Have you tried to place text or another simple control like Label along with the GridView in the System view and see if the active view is actually refreshed?
|
|
|
|
|
I can update the text propery of a label just after I do the bind and it shows the update.
I can also add all the items in the dataSET to a dropdownlist and it shows.
It is just the gridView which does not show the update - as if the bind has not worked.
Thanks
Colin
|
|
|
|
|
Hmm, is there any chance that the Grid control is rebound somewhere else in the web page? Here on my machine, I simply have two view with one containing a GridView control, every time I switch to that view I can see the gridview control displayed.
|
|
|
|
|
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?
|
|
|
|
|