|
It works and it should work for drop down list also.
Just check the spelling of the Control's Id and also check and confirm if ddl is not a null.
|
|
|
|
|
Hi thanks for the reply
I have already checked ddl, it is not null and the value is "[object HTMLSelectElement]".
This is my control
<asp:DropDownList ID="ddList" runat="server">
</asp:DropDownList>
Thanks and best regards
|
|
|
|
|
As Anurag suggested, please check the Id of the dropdown.
Moreover, where you are calling this javascript method Disable() from?
Just a Note :
May be you know this. You can avoid if..else condition by using,
btn.disabled = chk.checked ;
txt.disabled = chk.checked ;
ddl.disabled = chk.checked ;
|
|
|
|
|
Thanks
Arun Jacob wrote: please check the Id of the dropdown.
ID is correct and I got ddl(not null), the value is "[object HTMLSelectElement]"
Arun Jacob wrote: where you are calling this javascript method Disable() from?
The calling is at Checkbox onClick, I put this code in Page_load event:
Dim chk As CheckBox = CType(CreateUserWizardStep1.ContentTemplateContainer.FindControl("chkViewAll"), CheckBox)
chk.Attributes.Add("onclick", "Disable()")
Thanks and best regards
|
|
|
|
|
ddl.disabled = true; is correct and it should work. I hope AutoPostBack is false for CheckBox.
Alternatively you can try,
ddl.disabled = "disabled";
|
|
|
|
|
Arun Jacob wrote: I hope AutoPostBack is false for CheckBox.
Sure, AutoPostBack is false.
ddl.disabled = "disabled";
this doesn't work too
|
|
|
|
|
Okay.Then you can debug the method by using,
debugger;
debug the code and try to explore ddl object so that you can find the issue.
|
|
|
|
|
Use Dropdownlistname.visible=false property
like in aspx page
if(!page.ispostback)
{
Dropdownlistname.visible=false;
}
|
|
|
|
|
how i do for preview before upload image in asp.net on the cliend side
please help me
|
|
|
|
|
fuUpload.change(function() {
if ($.browser.msie) {
imgUser.attr("src", "file:///" + fuUpload.val());
} else if ($.browser.mozilla) {
imgUser.attr("src", document.getElementById('<%=fuUpload.ClientID%>').files[0].getAsDataURL());
}
});
|
|
|
|
|
Nice answer, but you forgot to mention that you must include jQuery script.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Hi All,
I'm about to start a new project that will query a database and return 6 possible combinations of result schemas and I'm trying to think of the best way to query and display the data on a single page. To clarify, there are tables in SQL that fit into one of six different schemas because we are working with six different systems that enter data into the database.
In a previous project, we were working with about 50 tables, all with the same schema. We were able to have standard queries, views and business objects. It was easy to use an objectdatasource and populate a gridview.
On this project, we want to display the data in a grid or other data control, and we only want to show the data from one table at a time. However, we aren't sure of the best approach for bringing that data into a single grid because the fields aren't consistent. Would it be a bad idea to construct a class with every possible property, use an objectdatasource and then hide and display fields in the grid? Maybe that's too outdated and there's a more modern way to handle the problem? One the other hand, I'm trying to avoid handling each schema separately. Does anybody have any suggestions of a better way? Any guidance is greatly appreciated.
Thanks,
Chuck
|
|
|
|
|
You could just set AutoGenerateColumns=true
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
Thanks Mark,
In the final piece of displaying the data that could do it. I'm wondering if my approach about building a class with every possible property, populating it from a stored procedure(s) and then displaying the collection in a grid is the way to go or if that's been replaced by some better way. Something about that doesn't seem like it's the best way. I'm might try looking into linq2sql or entity framework, but from my limited experience with them, I'm not sure if they offer an advantage.
Thanks,
Chuck
|
|
|
|
|
If the goal is the ability to display multiple schemas in a single grid then creating a class for every possible combination would be tedious overkill compared with AutoGenetrateColumns. Entity Framework does have advantages in CRUD operations, you don't have to write anything, and ORM. However, once again, if you only need to display the records, it would be overkill.
I know the language. I've read a book. - _Madmatt
|
|
|
|
|
That's good advice. I might just take the simplest approach and see how it works before trying anything else that's more complicated. It's a faster way to figure out if it's the right solution.
Thanks,
Chuck
|
|
|
|
|
Hi
I have a existing project and in the proect App_GlobalResources folder i have dll for every .resx file, for example if i have admin.en.resx then i have one dll as admin.resources.dll. i open the dll to read its manifest but no methods listed, i want to know why that dll needed and how it generated.
thanks
|
|
|
|
|
This[^] article might help you.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Hi
Thanks for your reply..
i found with the help of some articles that those dll's are satellite assemblies created with the help of resource file and because of App_Globalresources Folder not exists in previous versions of .NET Frame works, those compiled assemblies were used and also when delivering application to give as satellite assemblies is used.
so those dll's are satellite assemblies with the help of resource files.
|
|
|
|
|
any one help me
How to convert total data in a page into crystal report
|
|
|
|
|
Hello Friends
I have created user control in which there are two dropdown and two textbox are present.Now i am adding this user control dynamically for multiple time on button click event. Now i want to take all the value from dropdown list. So please help me in this
|
|
|
|
|
Expose your dropdownlist as a public property of your user control.
public DropDownList myDropDownList = ddlOfUserControl;
Then, in your page use it as
string selectedValue = myUserControl.myDropDownList.SelectedValue;
|
|
|
|
|
It's not a good idea to expose controls by making them public. The client program will be able to change the value or even worse, clear the dropdown by calling myUserControl.myDropDownList.Items.Clear() which is not what you want. See my answer for a better solution.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
Well, some times this might be required.
I totally agree, when not required, we can simply expose the portion which is required to be accessed.
But when we need, we can expose the DropDownList also. I had such requirement in my earlier project where we had to set the listItem values from Page.
|
|
|
|
|
Anurag Gandhi wrote: Well, some times this might be required.
There is not a single situation where it is required, you can always forward calls to your internal controls through properties and methods in the user control. Take your example, you could have created methods/properties that set the list item of your dropdown.
"Don't confuse experts with facts" - Eric_V
|
|
|
|