.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem with radiobutton list when viewstate disabled

Posted By:      Posted Date: October 21, 2010    Points: 0   Category :ASP.Net


I am having an issue with dropdown list when viewstate is disabled. The selectedindexchanged event fires even for the other events on the page.

I am pasting the code bello. To reproduce the issues I am mentioning please change the selected value of the dropdownlist and then click any button the selected indexchanged event fires even thought we didnot change the value.

<%@ Page Language="C#" AutoEventWireup="true"  EnableViewState="false" %>

<script runat="server">
	protected override void OnInit(EventArgs e) {
			new ListItem("Option 1"),
			new ListItem("Option 2"),
			new ListItem("Option 3"),
	protected override void OnLoad(EventArgs e) {
		SelectedValueOnLoadLabel.Text = OptionsDropDownList.SelectedValue;

	void OptionsDropDownList_SelectedIndexChanged(object sender, EventArgs e) {
		SelectedValueOnSelectedIndexChangedLabel.Text = OptionsDropDownList.SelectedValue;

    protected void btnTest_Click(object sender, EventArgs e)
        SelectedValueOnLoadLabel.Text = OptionsDropDownList.SelectedValue;

    protected void TestButton2_Click(object sender, EventArgs e)
        SelectedValueOnLoadLabel.Text = OptionsDropDownList.SelectedValue;

View Complete Post

More Related Resource Links

problem...i want a list item to populate all data in gridview!!!


i have a dropdownbox and a gridview

what I want is to have a list item which populates all data in a gridview.

I have tried using list item selected value=0 but to no avail.

what is the easiest way to achieve this?

Cascade Drop Down List Problem


I have 4 "cascade drop down linked" each other. The first one is "AccesoryFor", the second "TypeOfAccesory", the third "MarkOfAccesory" and the fourth "ModelOfAccesory".

The problem is that sometimes is possible in the web page I'm programming that a "Session Variable" could have a value that must be selected in one of that ddls. But not only that, the "ddl" or the entire "row" where the ddl is located ,must disappear. The problem is that, when the page does the rendering process, the others "cascade drop down" don't find its "control parents", so they stay disable and without data.

So, what I do in the Load Method:

 protected void Page_Load(object sender, EventArgs e)
        if (!IsPostBack)
            Session["AccesoryFor"] = "cellphone";

 public void loadValuesToUI()
    if (Session["consultarRecursos_AccesorioDe"] != null)
            rowAccesoryFor.Visible = false;

As the row where the first DLL is located dissapears, and error occurs saying that "Control-Parents" are not found. There's no way to "Disable" or make dissapear the ddl in the web-service because

Problem with list controls and update progress template



I have an update panel that surrounds a wizard control which I use in conjunction with a update progress control. Now my update progress control works perfectly, with my animated gif and div tag that lays over my wizard control when the user goes from step to step. However, there is a problem that I am struggling to solve. A number of my steps use controls like list boxes, and when the update progress control fires, the list control is not laying underneath my div an animated gif no matter how high a make my css z-index on the div.

Does anyone have a way of solving this?


Problem with SharePoint Designer 2007 and Custom List Forms


I created several forms (Create/Edit/View) for a SharePoint list, using Custom List Forms.  I'm using Content Types in the list to ensure that each item only has the necessary fields.  When I created the ASPX forms, and inserted the Custom List Forms, I selected the correct Content Type, and I got the right fields inserted in the form.

Now, for some reason I can't identify, every time I create a new form, and insert a Custom List Form, SPD is bringing ALL fields from the list, instead of just bringing the fields included in the selected Content Type.

I have tried many different things to solve the problem, including creating new lists/content types/forms, etc. but SPD is doing the same thing all the time.

Can somebody tell me what may have gone wrong in SPD or MOSS?


c# form problem with list item


I've got a c# form containing a listbox how ever i cant get

listbox1.items.Selected      to work



neither work. both not giving me the option for .selected nor selectedvalue

how does this work on c# forms as it works the above way on webforms....

.Sort a List problem



I have a little problem with sorting a List<String>.

I have put 4 elements like this and now are trying sort them correct. My example below shows the problem. I am not sure of how sort the names so they comes in this order: "Folder1, Folder2, Folder10, Foler11"  ?

List<String> GetNames = new List<String>();

GetNames .Add("Folder1");
GetNames .Add("Folder10");
GetNames .Add("Folder2");
GetNames .Add("Folder11");

GetNames.Sort(); //Sort the list

The sort comes in this order now which is wrong:

How to sort the list to have this order: ?



POST from html form viewstate problem

<p> Hi all, I have a website where people need to pay for a specific download (.pdf file). After they payed they get the download(A). My payment-provider can do a HTML-Postback to the site i want, for each succesfull payment. So the idea is that if someone payed, they do a postback to my server with a couple of parameters, so i can know that that specific email address has payed, and they get the download. I tested localy with a .html file on my desktop to postback a set of parameters to my local asp.net website. But in ONLY works if i include the __VIEWSTATE in my html file. And i cant get rid of the viewstate in my HTML of the aspx page. >test.html: <html><head></head><body> <h1>Dit is een test</h1> <form id="form1" action="http://localhost:25659/WebForm1.aspx" method="POST"> <input id="Button1" type="submit" value="submit!"/> 'IT ONLY WORKS IF I INCLUDE THE NEXT LINE: <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKMjA0OTM4MTAwNGRk" /> </form></body></html> Has anybody an idea to acomplish my goal? Maybe i can get some info about the postback in my global.asax? or create a HttpHandler for .html files? Anyone?   Thanks in advance, Vincent   </p>

radiobutton list item make visible true or false in javascript

in my project i have used one radiobuttonlist according different user login , i want to make one of radiobuttonlist item visible true or false..   please help me to solve this issue.   thanks in advance.  

Sharepoint 2010 List Added Event Problem

Hi All, I have created List Added Event Handler. In that Event I want to Add Custom Field in List as List is created. I get an Error "The Specified Program Requires    a newer version of windows" Is there ant solution for it. I have tried it also creating new instances of spweb and spsite rather than getting it from "Properties" Thanks Saumil Thakkar

Reorder list problem having to do with control placement

I have a page with a FileUpload control that uploads an image to a sql db when Button_Upload is clicked. I also have a reorder list contained within an update panel to display all the images in the database.The problem is with the code as shown below:1. I have the Button_Upload as an AsynchPostbackTrigger for the Update Panel2. The FileUpload.PostedFile=Nothing in Button_Upload_Click and no new image gets loaded.If I remove Button_Upload as an AsynchPostbackTrigger as a trigger then1. image gets added but reorderlist doesn't get refreshed and new picture doesn't appear in reorder list2. if I manually refresh browser button click event fires and image gets added againWhat is the way to place controls/triggers to get reorder list to show new picture when it gets added to the database? Thanks   <%@ Page Title="" Language="VB" MasterPageFile="~/sfcas_nofooter.master" AutoEventWireup="false" CodeFile="ImageUpload.aspx.vb" Inherits="ImageUpload" MaintainScrollPositionOnPostback="true" %> <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %> <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server"> <div id='leftside_fixproblem' &g

people picker problem, with multiple select lose the list.

<!-- /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {mso-style-parent:""; margin:0cm; margin-bottom:.0001pt; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} p {mso-margin-top-alt:auto; margin-right:0cm; mso-margin-bottom-alt:auto; margin-left:0cm; mso-pagination:widow-orphan; font-size:12.0pt; font-family:"Times New Roman"; mso-fareast-font-family:"Times New Roman";} @page Section1 {size:612.0pt 792.0pt; margin:72.0pt 90.0pt 72.0pt 90.0pt; mso-header-margin:36.0pt; mso-footer-margin:36.0pt; mso-paper-source:0;} div.Section1 {page:Section1;} --> Hi guys I have a master table with configuration for reports. when I load a InfoPath form (2010) for new report I have a approvers that set ok  , and I have  Notifies (multiple people) when I load a value form master they left me in the field only the first value(people) and lose the others. Do you know if there any way to load a multiple people value in people picker control?   Thank in advance Ramiro

List problem

I have a list in my website and am experiencing 2 strange problems: 1) I can automatically see the "List tool" panels for all the other lists in the site except for this particular list. I need to click on the web-part area hosting the list or an item of the list and only then the "List tool" panel at the top of the page appears. 2) Also, at the end of the list..I see only "+" button and do not see the "Add new item" text besides the "+" button.   Can someone help me please?

Document Set - Problem when uploading multiple files with "Launch forms in a dialog" disabled

Hello, Has anyone come across this before? I have a basic document library for which I have enabled "Allow management of content types" and disabled "Launch forms in a dialog".  Both of these settings are in the "Advanced Settings" page.  Also, the document library does not have versioning enabled and check out is not required. I added the OOTB "Document Set" content type to this document library and allowed OOTB "Document" content type documents in this document set.  This document set does not have any default content. The issue arises after I upload multiple files and click the "Done" button.  After I do this, the browser redirects to the top level of the site!  For example, if I uploaded to my document set at http://server/sites/anyname/doclib, I am redirected to http://server/. This issue has come up in both a standard server and an enterprise server. Steps to repeat issue: Create a document set Open the document set Select "Upload Multiple Documents" Drag and drop or browse for files Click "OK" Click "Done" Actually, this issue also occurs when "Launch forms in a dialog" is enabled.  In this case, you just have to navigate to the upload form directly (with all the necessary query string parameters, of course). Has anyone else seen this issu

gridview viewstate (size around 1.75Mb on each postback) very serious problem

i am developing a a web application of a general store where the operator has to enter the things what cutomer has purchased..like daily useage item,or anyhing ..so i have form in which i first ask how much item u wanna regsiter...(if he has 20-30 number of items then operator will eneter 20-30 then in gridview 20-30 item are opened...with bind dropdownbox containing name of item ,then textboxs containing mrp,value,stock avail of that item .here is the link for demo... http://iconsoftech.com/mahajan/grid/gridview_test.aspxproblem is suppose the operator enter the value above 20.. then then viewstate size id about 1.50Mb thats too heavey please suggest me solution for this problem..<%@ Page Language="C#" AutoEventWireup="true" CodeFile="gridview_test.aspx.cs" Inherits="gridview_test" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title>Untitled Page</title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label ID="Label4" runat="server" Text="Enter No. Of Products"></asp:Label&g

problem with displaying items in list view web part

I have a list view webpart at default display form. Default Display form display items (for example) from the contracts documents library. List view webpart also associated with the same documents library (contracts). In such case this webpart doesn't display any item. But if I add another list view web part associated with warrants document library it display item without any problems. Is it possible to bind list view webpart to another data source for contracts document library? Or maybe another solution? Thanks!

problem in Business Data list webpart

<Entity EstimatedInstanceCount="100" Name="Customer">



problem in Business Data list webpart

<Entity EstimatedInstanceCount="100" Name="Customer">



ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend