|
You need to write all of this in javascript, because you want it to happen on the client side. There's nothing built in to do it. you can handle the data bound event of the checkboxlist to inject attributes on the control, which is how you would handle the click or check changed events in order to fire your scripts. Then, you can just keep track of the ids of items that have been clicked and which ones are checked in your script and show a message if a third is clicked on.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
no no.
actualy i am showing messege througt javascript but i want to get the id of the checkbox for restrict the check if user has allready completed max checks.
rajeev kumar sharma
vri software pvt. ltd.
new delhi India
|
|
|
|
|
I think this will work for u.
Dim i As Integer
For Each item As ListItem In CheckBoxList1.Items
If item.Selected Then
i = i + 1
End If
Next
If i > 2 Then
lblmsg.Text = "Thanks"
Else
lblmsg.Text = "Please Select atleast two items"
End If
God is always with you.
|
|
|
|
|
sorry this code can restrict only the number or selection but suppose i had select 2 and 7 item from the checkboxlist and i m selecting the 4th item in the list then how can i restrict for selection but server side code will post back the page so i want to do this with the javascript
rajeev kumar sharma
vri software pvt. ltd.
new delhi India
|
|
|
|
|
Hi Everyone,
Is it possible to have thousand seperators and currency format in a datagrid. Can anyone help me in this regard.
Regards,
Manowj
|
|
|
|
|
Yes, just define them in your column definitions for the grid, by using ToString on the data items you're showing with a formt string.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Paste below function into .VB file
Function IndiaRupees(ByVal rs As String)
Dim str As String = ""
str = Right(rs, 3)
rs = Left(rs, IIf(rs.Length > 3, rs.Length - 3, 0))
While rs <> ""
str = Right(rs, 2) & "," & str
rs = Left(rs, IIf(rs.Length > 2, rs.Length - 2, 0))
End While
IndiaRupees = "Rs. " & str
End Function
In Datagrid's Item Databound
Dim lbl_Amt As Label<br />
lbl_Amt = IndiaRupees(CType(e.Item.FindControl("lbl_Amount"), Label).Text)
Prakash Samariya
|
|
|
|
|
Hi friens,
I could display several menuitems by vertically and horizontally for SINGLE menu.
But My problem is i want to display MULTIPLE menus(Eg:3 menu) as a headers then i have to display several menuitems by HORIZONTALLY for each menu.
Please help me..
|
|
|
|
|
Use Menu Control from asp.net.and set the properties for the Vertical and horizontal display.It' easy
|
|
|
|
|
Hi Friend,
Please give me with simple example.I couldn't find. Please..
-- modified at 7:50 Friday 2nd November, 2007
|
|
|
|
|
Doing This way
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal">
<Items>
<asp:MenuItem Text="File" Value="File">
<asp:MenuItem Text="Open" Value="Open"></asp:MenuItem>
<asp:MenuItem Text="New" Value="New"></asp:MenuItem>
</asp:MenuItem>
<asp:MenuItem Text="edit" Value="edit">
<asp:MenuItem Text="Copy" Value="Copy"></asp:MenuItem>
</asp:MenuItem>
</Items>
</asp:Menu>
|
|
|
|
|
Hi Friend i used your code. It displays the menuitem only by vertically. I need to display horizontally. Here "Open" and "New" display only vertically. I need to display by horizontally. For that what should i do? That is my main need..
Thanks. please reply.
|
|
|
|
|
Set the Orientaion Properties.
In Design View right click on the menu and go to the edit menu item.Than set
the Properties.Try your self it is easy.
|
|
|
|
|
What does Len do ? If it returns the length of a string, try using the Length property instead.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
lenth function having in asp.net
please give a coding then i try for your answer your question
Viggneshwar.A
|
|
|
|
|
Sounds like the server is hosed. What do you mean by 'not working' ? What happens ?
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi All
I need to develop one regular expression that is validating Name field in my application So Name can contain 0-9a-zA-Z. ,./()&'- this type of fields
but the problem is if i put only blank spaces then it is returning true
please help me it should not take bank place i can't put if else block as i have to give Expression to my validator
eg "sandeep01 Akhare&(Peter's)" it ok
but " " no should not take
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Use RequiredFiledValidator along with this RegularExpression validator
|
|
|
|
|
Hey Navaneeth
the problem here is we can't use asp validator for our application as after firing we are changing the style sheet of controls (in base control) by re rendering its content
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
I guess this can't be done on a single regular expression. Are you allowed to use a custom JS function, Then you can make use of two expressions and validate it.
|
|
|
|
|
Ya that's what i was thinking but i am very poor in Regular expressions so thought lets post it in CP.
No we are doing all validations aat server side only
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
playing with bugs ) wrote: No we are doing all validations aat server side only
Use Trim function and check the length. This will trim white spaces in the both end. You can add whitespace trimming in regular expression too. But I think it will remove the spaces in between the words (Sandeep Akhare)
playing with bugs ) wrote: i am very poor in Regular expressions
It's very interesting. Download RegExBuddy. It's a ultimate tool, and it helped me a lot to learn regular expressions.
|
|
|
|
|
N a v a n e e t h wrote: Download RegExBuddy
Thanks I will do that ...
N a v a n e e t h wrote: Use Trim function and check the length
That's what i am doing finally
// Check for blank spaces In both first and last Name fields
if (String.IsNullOrEmpty(txtFirstName.Text.Trim()))
{
this.reqFirstName.IsValid = false;
}
reqFirstName is my validator derived from custom validator
this line of code i am writing in my Pages not in validator
then question will be why i have used this validator.
i think its not proper implementation of validator
Any way thanks for your suggestions and providing me RE tool
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
use both requiredfieldvalidator and regularexpressionvalidator
|
|
|
|
|