|
You'll need to write a bit of javascript there as most single keystrokes do not, thankfully, cause a postback to the server.
Try subscribing to the document.onkeyup event. If you determine that the up or down key was hit, force a postback and handle moving the datagrid selecteditemindex on the server. This will not be super fast as you'll postback a lot, but otherwise, I'm not sure how you can set the selecteditemindex in javascript as I believe it is in the viewstate. Try googling on selecteditemindex and javascript to see if you can make it happen w/o the postback.
|
|
|
|
|
but i want this only on client side using javascript without postback.
|
|
|
|
|
I hear ya. But I'm pretty sure the 'selectedindex' property of the datagrid is in the viewstate, which you are not supposed to mess with on the client manually (1st it's encrypted, 2nd ms says don't do it as they might change the format). Google selectedindex and javascript and datagrid and see what you can come up with.
|
|
|
|
|
There was an error message System.NullReferenceException was unhandled by user code
Message="Object reference not set to an instance of an object.".
Here is my code. Is there anything wrong? I have already set the PostBackUrl button from the previous page.
<br />
if (!Page.IsPostBack)<br />
{<br />
TextBox t = (TextBox)PreviousPage.FindControl("txtStartDate");<br />
lblStartDate.Text = t.Text;<br />
}<br />
-- modified at 0:06 Monday 7th August, 2006
thanks in advance. Much appreciated.
|
|
|
|
|
I suppose you don't have txtStartDate textbox on your page, thats why this exception is raised.
Pilo
|
|
|
|
|
i have that textbox obviously.
thanks in advance. Much appreciated.
|
|
|
|
|
In this case, if you really want people to help you to solve this problem, you should copy - paste your code.
if you declare this TextBox in aspx file, then paste it here (at least relevant part), if you create it dynamicaly, paste here code where you do so.
There is a possibility, that problem is with lblStartDate.
Try to debug your application and check each value, you will see if FindControls returns your desired textBox and if lblStartDate is not null.
Pilo
|
|
|
|
|
hi,
i think you are not giving the currect textbox name or textbox is not present
check the textbox name.
thanks
|
|
|
|
|
thanks. i checked many times, but it seems i type correctly, or rather copy paste correctly.:->
thanks in advance. Much appreciated.
|
|
|
|
|
Hi,
The problem could be, the reference to the page were the textbox(txtStartDate)is available might not be referred. If the textbox has to be referred from the current page were you want the reference you can do so by.
if (!Page.IsPostBack)
{
TextBox t = (TextBox)this.Page.FindControl("txtStartDate");
lblStartDate.Text = t.Text;
}
Hope this should work
Regards
Mohan
|
|
|
|
|
I tried and I faced same error.
I should be clearer with the error. It says:
if (!Page.IsPostBack)<br />
{<br />
TextBox t = (TextBox)this.Page.FindControl("txtStartDate");<br />
lblStartDate.Text = t.Text;<br />
}
<big>lblStartDate.Text = t.Text;</big> The error stops at this line saying "Object reference not set to an instance of an object."
The troubleshooting tips were:
Use the "new" keyword to create an object instance.
Check to determine if the object is null before calling the method.
thanks in advance. Much appreciated.
|
|
|
|
|
I hope my MS visual is not haunted.
thanks in advance. Much appreciated.
|
|
|
|
|
Is that TextBox is inside any other controls like DataGrid,DataList or Panel. The reason for the Problem could be:
1) If the TextBox(txtxStartDate) is not available in the respective page.
2) If the page reference is not set when calling this.Page.FindControl
3) If the TextBox is inside some other controls like DataGrid,DataList or Panel.
Please do check and come around.
P. Mohan
|
|
|
|
|
I am using MaterPages + .NET 2.0 Login Control.
I observed that if my webform had not used the MasterPages or the webform was not autheticated by the Login Control, the postback will work fine.
Is there a diferent code?
thanks in advance. Much appreciated.
|
|
|
|
|
I have a .exe file on my disk,I want to execute it using web form.
so,how should I write the code?
thank you!
KSCsoft
|
|
|
|
|
|
Hi, good day..
i face a problem when i debug my project. I'm using asp.net 1.1 to develope the project. When i start to debug my project, an error message display. The error message show like "Cannot start debugging. Cannot find Internet Explorer". What is the main cause of this problem? Before that i run well with my project.. Anyone can help me? Thanks..
Best Regards,
Pei Sun
|
|
|
|
|
Hai
I would like to show Five day weather forecast om my website . I gone through lot of webservices which provides only US weather infoemation. I need weather report of india. Can any one get me a good webservie that satisfy my needs
|
|
|
|
|
Weather.com's XML data feed[^] provides weather information for more than 50,000 locations worldwide (including India). See this[^] example.
/ravi
|
|
|
|
|
i am trying to write the values of a dataset to a database but all the examples i am seeing shows you how you update the changes to a dataset to the database but what i am doing is that i copied out data out of one database and i want to back up it by saving it to this other database, but not really seeing any example as to how to jus write contents of the dataset to a datbase the second database has all the relvant table name and columns
kenny
|
|
|
|
|
|
I am trying to get the same functionality from MasterPages as I get when I use the html.<frames> tag.
I.e. I have 3 frames but only Number 3, which is my content frame, is refeshed the rest of the page remaned static no flickering.
switches I have used in combination:
<pages
="" smartnavigation="true" autoeventwireup="true">
I am nesting masterpages(MP) and on MP1 I have the header section and in MP2 Navigation
Problem: MP1 refreshes when MP2 refreshes. I was expecting MP1 not to refreash and MP2 content placeholder to refresh to navigation selected from MP2 sitemap
Any "help" or "directions to get help" is appreciated.
|
|
|
|
|
What you are trying to do can not be accomplished using master pages. Master pages are used to separate the contents when creating a page, but the final page that is sent to the browser has no signs of the separation. The place holders only exist on the server side. When the page is complete, there is no sign of the place holders. As the place holders don't exist at the client side, you can't update the contents of a place holder without recreating the entire page.
What you are trying to do can be accomplished using ATLAS[^], though.
---
b { font-weight: normal; }
|
|
|
|
|
Thanks for your help.
|
|
|
|
|
I am still having the same flickering issue with ATLAS in place.
From the Main MasterPage
*atlas:ScriptManager ID="SM1" EnablePartialRendering="true" runat="server">
*/atlas:ScriptManager>
*atlas:UpdatePanel ID="p1" runat="server">
*ContentTemplate>
*div>
*asp:ContentPlaceHolder ID="MainPlaceHolder" runat="server">
*/asp:ContentPlaceHolder>
*/div>
*/ContentTemplate>
*/atlas:UpdatePanel>
With the above code one would think that when the Parent would not refresh when the child does.
-- modified at 17:01 Monday 7th August, 2006
|
|
|
|