473,796 Members | 2,494 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with autopostback on webcontrols

I've got a simple page I've made with a few controls (Treeview,
Dropdownlist, ..). I'm running into an issue with autopostback. If I
set it to AutoPostBack = "True", when the event should fire I get a
Javascript error in IE.

If I don't set it, and let a button click do the postback, the event
fires normally.

*note: using visual studio 2005 + dotnet 2.0

Any help would be greatly appreciated.

IE Error:
Line: 34
Char: 9
Error: Object doesn't support this property or method.
Code: 0
URL: http://localhost:4022/ReportSchedule...geReports.aspx

markup:
<form id="form1" runat="server">
<asp:Table runat=server ID="contentTabl e" >
<asp:TableRow >
<asp:TableCel l VerticalAlign=" Top">
<asp:TreeView runat=server ID="reportListi ng"
OnSelectedNodeC hanged="reportL isting_Selected NodeChanged">
</asp:TreeView>
</asp:TableCell>
<asp:TableCel l VerticalAlign=" Top">
<asp:GridView runat=server ID="reportDetai ls">

</asp:GridView>
</asp:TableCell>
<asp:TableCel l VerticalAlign=" Top">
<asp:DropDownLi st runat="server"
ID="frequencyLi stDropDown" AutoPostBack="t rue"
OnSelectedIndex Changed="freque ncyListDropDown _SelectedIndexC hanged">
<asp:ListItem
Selected=True>D aily</asp:ListItem>
<asp:ListItem>W eekly</asp:ListItem>
<asp:ListItem>M iddle And End Of
Month</asp:ListItem>
<asp:ListItem>M onthly</asp:ListItem>
</asp:DropDownlis t>
</asp:TableCell>
<asp:TableCel l VerticalAlign=" Top">
<asp:CheckBoxLi st runat=server ID="daysOfWeek "
RepeatDirection ="Horizontal " Visible=false>
<asp:ListItem>S unday</asp:ListItem>
<asp:ListItem>M onday</asp:ListItem>
<asp:ListItem>T uesday</asp:ListItem>
<asp:ListItem>W ednesday</asp:ListItem>
<asp:ListItem>T hursday</asp:ListItem>
<asp:ListItem>F riday</asp:ListItem>
<asp:ListItem>S aturday</asp:ListItem>
</asp:CheckBoxLis t>
<asp:Calendar runat=server ID="monthDaySel ect"
Visible=false></asp:Calendar>
</asp:TableCell>
</asp:TableRow>
<asp:TableRow >
<asp:TableCell> </asp:TableCell>
<asp:TableCell> </asp:TableCell>
<asp:TableCel l>
<asp:Button runat=server ID="submit"
OnClick="submit _click" Text="Submit" />
</asp:TableCell>
</asp:TableRow>
</asp:Table>
</form>

Codebehind:

public partial class ManageReports : System.Web.UI.P age
{

protected void Page_Load(objec t sender, EventArgs e)
{

if (!IsPostBack) //set up initial page
{

System.Data.Dat aSet reportList = new DataSet();
reportList.Read Xml(Server.MapP ath("Reports.xm l"));
foreach (DataTable t in reportList.Tabl es)
{
foreach (DataRow dr in t.Rows)
{
TreeNode parentNode = new TreeNode();
parentNode.Text = dr.Table.TableN ame;
reportListing.N odes.Add(parent Node);
foreach (string innerRow in dr.ItemArray)
{
parentNode.Chil dNodes.Add(new
TreeNode(innerR ow));
}
}
}
}
}

protected void frequencyListDr opDown_Selected IndexChanged(ob ject
sender, EventArgs e)
{
//if (IsPostBack)
{
if (frequencyListD ropDown.Selecte dValue == "Monthly")
{
daysOfWeek.Visi ble = false;
monthDaySelect. Visible = true;

}
else if (frequencyListD ropDown.Selecte dValue == "Weekly")
{
daysOfWeek.Visi ble = true;
monthDaySelect. Visible = false;
}
else if ((frequencyList DropDown.Select edValue == "Daily")
|| (frequencyListD ropDown.Selecte dValue == "Middle And End Of Month"))
{
daysOfWeek.Visi ble = false;
monthDaySelect. Visible = false;
}
}
}

protected void submit_click(ob ject sender, EventArgs e)
{

}

protected void reportListing_S electedNodeChan ged(object sender,
EventArgs e)
{

}

Jan 21 '06 #1
1 2643
EJD
Sean,
I would suggest looking at the following article as it has helped me a
great deal. I don't know if this applies to ASP.Net 2.0 because I
haven't tried it ***yet***, but it works well in the earlier
version(s).
http://devcenter.infragistics.com/Ar...ArticleID=2183
Granted, it's hard to tell what is going wrong without seeing a view
source on the page, but it seems likely that one or more of the
"OnSelectedInde xChanged" or "On...Node" could be funky. And you've
probably already done this, but just in case you haven't, do a view
source on the page and check out what's in the neighborhood of "line
34."
HTH, and good luck.
Eric

Jan 21 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
3303
by: Jesse | last post by:
I have a relatively long page with a number of webcontrols with "autopostback" set to true. The contents/items/datasources of the subsequent webcontrols are dynamically populated depending on the selection of previous webcontrols' selected item. My question is : everytime the user selects an option from a webcontrol, due to the autopostback being turned on, the page refreshes itself to populate the subsequent controls. The problem I have...
2
2670
by: bill yeager | last post by:
When trying to run my web project, I get the following error: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The base class includes the
2
1787
by: SLE | last post by:
A web user control exposes a RadioButtonList (with AutoPostBack = true) called "Question". This control also has an embedded RequiredFieldValidator control. 1. Main ASPX page is populated with several "Questions". 2. Within the code of the main page, there is a SelectedIndexChanged handler for the RadioButtonList exposed by Question. The function loops through a number of questions on the pages and hides/shows questions (control.visible...
1
8424
by: Edward | last post by:
I am having a terrible time getting anything useful out of a listbox on my web form. I am populating it with the results from Postcode lookup software, and it is showing the results fine. What I want to do is to allow the user to click on the row that corresponds to the correct address, and have the code behind populate the form's Address1, Address2 etc. controls with the relevant data items. I put the code for this into the...
10
3089
by: Brian Henry | last post by:
Hi, I am having a problem with an attachment system I made... it works with files up to ~3MB in size then after that if you try to upload a file it just goes to a "Page can not be displayed" page like it tried to do it but errored... I thought changeing the max size for the file input box to about 100mb would fix it but nope here is my page code and my code behind code... ===============
3
2165
by: Microsoft Newsgroups | last post by:
Hi all, I'm having an interesting problem with my IE Webcontrols. I'm using the toolbar and when I test it in my browser using "http://localhost/mysite", it works fine. Incidentally, I have "mysite" set up as a web application. Now when I test it going through "http://mysite/no-ip.org" then the toolbar doesn't work properly. It seems to merely render the images and any subsequent embedded Javascript but there are no events fired to the...
2
3234
by: tshad | last post by:
This is related to my other Hiding datalistitems problem that I can't seem to solve. I have tried different methods which all seem to work only partially. I decided to try to use a User Control (which I'm sure is not done correctly) and get errors as I try to execute it. What I want to do is take all the data from between the ItemTemplate tags and put a control there. The I hope to be able to hide all the user
5
1734
by: hanolo | last post by:
Does anyone ever see this happen. I build a form with couple of textbox server control. When user inputs character ` in there, after form post back, the textbox become a line of string such as <INPUT id=_txtName style="WIDTH: 70%" value=` name=_txtName>. I can filter out ` from the inputs, but it seems like a microsoft bug to me.
2
4558
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am doing the following:
0
1094
by: Bieniu | last post by:
I have DataList control on my own contro land it is bind to SqlDataSource control. My problem is that DataList is getting needed data twice what is for me very strange. I have some code in OnSelected event of SqlDataSource, and i was suprised when it was fired twice for every page loading. His is code of datalist: <tr> <td style="width: 5%;"> </td> <td colspan="3">
0
10231
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10013
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7550
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6792
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2927
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.