|
Hi All,
How to set the all child control in Panel to Readonly Mode.
i have nearly 18 TB, 10 RadioButtionList and 10 DropdownLists in Panel Control.
Need a function which set the all the controls Readonly mode..
JohnDas
|
|
|
|
|
You can loop through the control collection for the panel and set the ReadOnly property as true wherever applciable. You can make use of reflection instead of switch cases. Like this:
PropertyInfo propInfo = this.Controls[ctrlIndex].GetType().GetProperty("ReadOnly");
if(propInfo != null)
propInfo.SetValue(this.Controls[ctrlIndex], true, null);
In case the control does not has a ReadOnly property, you can check for Enabled .
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Good answer....
|
|
|
|
|
Thanks.
50-50-90 rule: Anytime I have a 50-50 chance of getting something right, there's a 90% probability I'll get it wrong...!!
|
|
|
|
|
Good answer! I was think about using switch case with in a loop, but this is even simpler!
Very good & Thanks!
|
|
|
|
|
hii all....
i am using role and membership provider in my website.The default password validation
when we create new user is given such that the password length must be atleast seven characters and shud be alpha numeric.I want to cutomize this validation to make it simple for user.how can i do it.plz guide me.....
thank's in advance.........
|
|
|
|
|
Add a validator (or two)to the password text box so that it checks for the character size and characteristics you are after...
|
|
|
|
|
Below Is the sample to Customize in web.config file..!
<membership>
<providers>
<clear/>
<add name="AspNetSqlMembershipProvider"
connectionStringName="MyAspNetDB"
enablePasswordRetrieval="false"
enablePasswordReset="true"
requiresQuestionAndAnswer="false"
applicationName="YouApplication"
requiresUniqueEmail="true"
passwordFormat="Hashed"
maxInvalidPasswordAttempts="100"
minRequiredPasswordLength="5"
minRequiredNonalphanumericCharacters="0"
passwordAttemptWindow="10"
passwordStrengthRegularExpression=""
type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</providers>
</membership>
|
|
|
|
|
|
Any Time..!
|
|
|
|
|
|
Hi!
How can I create a ItemTemplate Checkbox that that gets the data from a database and display only the checkboxes and not the TRUE or FALSE text.
The Code I currently have looks like this:
<asp:TemplateField>
<ItemTemplate>
<asp:Checkbox id="chkLunch" runat=Server Text='<%# (DataBinder.Container, "IsLunch")%>'></CheckBox>
</ItemTemplate>
</asp:TemplateField>
If I change the "Text" to "Checked" I get a Cast error.
Can anyone please help?
Illegal Operation
|
|
|
|
|
Use ctype function.
Be an Eagle, Sky is Yours.
|
|
|
|
|
and that would mean? I am using C#
Illegal Operation
|
|
|
|
|
Illegal Operation wrote: <asp:checkbox id="chkLunch" runat="Server" text="<%# (DataBinder.Container, "IsLunch")%>">
Use Checked Property for that.
Like :
<asp:Checkbox id="chkLunch" runat=Server Checked='<%# Convert.ToBoolean(Eval("DBField")) %>'.....
DBField should the field of your database.
It will resolve your issue.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
Sorry, I didn't see your post before replying, so replied similar answer.
|
|
|
|
|
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
LatestArticle :Log4Net
Why Do Some People Forget To Mark as Answer .If It Helps.
|
|
|
|
|
Try this:
<asp:CheckBox ID="chkLunch" runat="server" Checked='<%# Convert.ToBoolean(Eval("IsLunch")) %>' />
This should work provided IsLaunch should return value that is convertable to Boolean.
|
|
|
|
|
Thank you very much!! Your answer solved my problem.
Illegal Operation
|
|
|
|
|
Have you tried like this :
<asp:templatefield headertext="Author Name">
<itemtemplate>
<asp:Checkbox id="chkLunch" runat="server" Text= '<%# Eval("IsLunch") %>' />
</itemtemplate>
Means have you placed in the ItemTemplate of asp:templatefield ?
|
|
|
|
|
Hi
How can i attach a procedure to a control from the same type in all pages in my asp.net application?
I use masterpage.
|
|
|
|
|
Member 3082665 wrote: How can i attach a procedure to a control from the same type
I didn't get your question, can you be please explain in details.
Thanks !
Abhijit Jana | Codeproject MVP
Web Site : abhijitjana.net
Don't forget to click "Good Answer" on the post(s) that helped you.
|
|
|
|
|
hello,
how to declare an enumeration or a reonly variable or a constant in a web service ??
regards.
dghdfghdfghdfghdgh
|
|
|
|
|
The same way you would do in any other class
Alexei Rodriguez
|
|
|
|