|
Use this pattern: "\d{2}/\d{2}/\d{4}".
This will of course only verify that the format is correct, it can't verify that the date actually exists. You can make the verification a bit better by making sure that the date is in the range 1 to 31 and so on, but still that won't see that a date like 31/02/2006 does not exist.
---
b { font-weight: normal; }
|
|
|
|
|
You can use the CompareValidator with the DataTypeCheck operator and Type="Date" to validate if the textbox value is a valid date. You also should remember that the date format used by the validator is specified based on the current culture value when the validator control renders, for example if the current culture is set for the "en-GB" value, then the dateorder will be mdy , and the validator will accept the values like 18/4/2006 or 18/04/2006 ..., the delimiter can be either - or / . If you want to use the fixed format like you said, you can either implement a custom validator for this or use an additional RegularExpressionValidator with the pattern suggested by Guffa. For more information on how to set the culture value, you can see MSDN[^]
|
|
|
|
|
Use Compare Validator that would be correct solution in this scenario
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
I am using an evaluation period tool named as SoftArtisan Office Writer.
I hav got an error while using one of the feature in my code that is
Invalid license key: format is out of range. : (SoftArtisans.ExcelWriter [ Invalid license key: format is out of range. ] 6.5.4.0430 (03282006-111331-ACHILLES))
It comes after adding this code
ExcelApplication xla = new ExcelApplication();
xla.Create();
it allows me to create ExcelApplication obj but while i Create application that is using xla.Create() it generates the above error.
Can anybody suggest me its giving me such error just becoz i m using evaluation period software and it disabled few facilities or something else
waiting for reply
thanx
Saima
|
|
|
|
|
Hi there,
IMHO, you might want to check out their support[^] site.
|
|
|
|
|
Hi
I currently have a paging mechanism for my datalist control which is displaying a gallery of Images. The code is a modified version of the code from HERE. I would like to modify the control to allow for paging through the images similar to the paging mechanism found on google. Only, there will be a fixed number of pages displayed and there will be a next and previous button as well.
<< Prev 1 2 3 4 5 Next>>
So far what I've been able to achieve is: I am able to page through pages 1 to 5, in any order. All the buttons are linkbuttons.
Here is what I need to still do:
1. Allow the next button to move through the currently displayed pages
2. When the user is on the last page and clicks the next button, the next page needs to be displayed and the linkbuttons need to change to show the next 5 page numbers too.
Can anyone help me as to how I can go about starting this or if anyone else has done this or is busy with a similar thing, please, any and all help will be brilliant.
Thanks
|
|
|
|
|
Hi All,
How to make a code to enter the text in the text box should be uppercase?
If the user enter lowercase.. it should be displayed in the textbox as uppercase?
Pls suggest me with sample code in vb.net
thanks
Paul
|
|
|
|
|
Use ToUpper() Function in Key Press event
"Aim to go where U have never been B4 and Strive to achieve it"
http://groups.yahoo.com/subscribe/dotnetforfreshers
http://himabinduvejella.blogspot.com
|
|
|
|
|
Thanx for your suggestion.
there is no keypress event in ASP.NET textbox
iam asking the things in asp.net
By
Paul
-- modified at 3:45 Tuesday 18th April, 2006
|
|
|
|
|
You can't use ASP.NET to change the input as the user writes it, only to change it once it's posted to the server. You have to use Javascript to change the text in the textbox.
---
b { font-weight: normal; }
|
|
|
|
|
pls give any sample code.
I think using textbox.attributes will help for this(i don't know exactly)
thanks
paul
-- modified at 4:32 Tuesday 18th April, 2006
|
|
|
|
|
You can just put this line into your code behind (my asp textbox was just the default "TextBox1":
this.TextBox1.Attributes.Add("onkeyup","this.value = this.value.toUpperCase();");
|
|
|
|
|
hi,
I want to refresh a page after every 5 minutes automatically. The thing is that i donot want to refresh the whole page, i want to refresh only the gridview on the page (not the other controls like dropdownlist, text box, etc.)
I need to use-Light weight postback only not any other techniques like AJAx etc
if anyone have a code for this in ASp.net 2.0 (c#), please send it to me. i willl be highly greatful to u.
thanx
sandeep
|
|
|
|
|
i want to traverse through a treeview web control and fetch the ID's of all checked nodes.
that is, all those nodes whose checkboxes are checked in a treeview.i want to get their Id's.
i've used the following code :
''' For getting selected contact id's from the Group Tree
Function GetContacts() As ArrayList
Dim mnode As Microsoft.Web.UI.WebControls.TreeNode
Dim contacts As New ArrayList
Viewstate("ContactCounter") = 0
For Each mnode In TV_MasterContactList.Nodes
GetSelectedContactID(mnode.GetNodeIndex, contacts)
Next
Return contacts
End Function
Sub GetSelectedContactID(ByVal Tnode As String, ByRef Contacts As ArrayList)
Dim nnode As Microsoft.Web.UI.WebControls.TreeNode
If TV_MasterContactList.GetNodeFromIndex(Tnode).Type = "Contact" And TV_MasterContactList.GetNodeFromIndex(Tnode).Checked = True Then
Contacts.Add(TV_MasterContactList.GetNodeFromIndex(Tnode).ID)
End If
For Each nnode In TV_MasterContactList.GetNodeFromIndex(Tnode).Nodes
GetSelectedContactID(nnode.GetNodeIndex(), Contacts)
Next
End Sub
but its not giving the correct result
regards,
Kapil
|
|
|
|
|
So what does it give you? Do you assign the ID value which you expect to receive to the ID property of the TreeNode?
|
|
|
|
|
when i check some checkboxes and on button click call these functions to retrieve the checked checkboxes Id.
it shows even the checked checkboxes as unchecked and thus doesnt returns any Id's
|
|
|
|
|
You might want to debug your application and try to step through your sample code line by line. Also, i'm curious that why you don't just use the TreeNode instance from the Nodes collection instead of using the GetNodeFromIndex method. Anyway, below is a quick example for this:
private ArrayList GetContacts()
ArrayList Contacts = new ArrayList();
foreach(TreeNode node in TV_MasterContactList.Nodes)
{
GetSelectedContactID(node, Contacts);
}
return Contacts;
}
private void GetSelectedContactID(TreeNode node, ArrayList Contacts)
{
if(node.Checked)
Contacts.Add(node.ID);
foreach(TreeNode child in node.Nodes)
{
GetSelectedContactID(child, Contacts);
}
}
|
|
|
|
|
Usually to change a controls Property using script I just use ID.Property = "What I want"
But BoundField doesn't have an ID so now what?
|
|
|
|
|
You can access the field using the Columns collection of the GridView or the Fields collection of the DetailsView, that depends on which control you use.
|
|
|
|
|
Hi I have a problem with binding parameters to an update command for an asp:SqlDataSource. The problem is when I am trying to bind a ASP:CheckBox field.
I have this definition
<asp:FormView ID="HomeListingForm"
runat="server"
DataSourceID="SqlHomeListing"
BackColor="#DEBA84" BorderColor="#DEBA84" BorderStyle="None"
BorderWidth="1px" CellPadding="3" CellSpacing="2" GridLines="Both"
DefaultMode="Edit"
>
<EditItemTemplate>
<table>
…………….
<tr>
<td >
<asp:CheckBox ID="ckMealsAvailable" Text="Meals Available" Checked ='<%# Convert.ToBoolean(Eval("MealsAvailable")) %>' runat="server" />
</td>
<td >
<asp:CheckBox ID="ckPrivateLivingArea" Text="Private Living Area" Checked ='<%# Convert.ToBoolean(Eval("PrivateLivingArea")) %>' runat="server" />
</td>
</tr>
</table>
---------
</asp:FormView>
<asp:SqlDataSource ID="SqlHomeListing" runat="server"
UpdateCommand ="UPDATE HomeListing SET AddressLine1 = @AddressLine1, AddressLine2 = @AddressLine2, City = @City, PostalCode=@PostalCode, ProvinceId = @ProvinceId, PrivateLivingArea = @private_living_area WHERE ListingId = @ListingId"
ConnectionString ="<%$ …….. %>" >
<UpdateParameters>
<asp:FormParameter Name="AddressLine1" Type="string" FormField="AddressLine1" DefaultValue =""/>
<asp:FormParameter Name="AddressLine2" Type="string" FormField="AddressLine2" DefaultValue = "" />
<asp:FormParameter Name="City" Type="string" FormField="City" DefaultValue =""/>
<asp:FormParameter Name="PostalCode" Type="String" FormField ="PostalCode" DefaultValue =""/>
<asp:FormParameter Name="ProvinceId" Type="Int32" FormField ="Province" DefaultValue ="0"/>
<asp:FormParameter Name="private_living_area" FormField ="ckPrivateLivingArea" Type="Int16" />
<asp:SessionParameter DefaultValue = "0" Name="ListingId" Type="String" SessionField="ListingId" />
</UpdateParameters>
</asp:SqlDataSource>
I am getting this error; Cannot insert the value NULL into column 'PrivateLivingArea', table 'RentalProperty.dbo.HomeListing'; column does not allow nulls. UPDATE fails.
The statement has been terminated.
I know what it means but I can not figure out how to bind this checkbox field to the query parameters
|
|
|
|
|
Hi there,
The Eval method supports one-way (read-only) binding, here there are two options:
+ You can use the Bind method which supports two-way databinding instead of the Eval , you can read more about this in MSDN[^].
+ You can create a handler for the Updating event of the SqlDataSource control, in the method you can query the value of the check box and pass it to the input paramaters of the command.
|
|
|
|
|
Hi Everyone
I have my application in ASP.net and C#. I want to print datagrids on one of the ASP.net pages as a well formatted report. Could anyone please guide me how to go about this?
Thanks a lot in advance
Dipty
|
|
|
|
|
you have two options either put the grid which you want to print on a different page and on click of print open that page as a pop up and print view and on that page write a javascript function for printing it.
Or you can put grid in a div on same page and call print in javascript on same page.
|
|
|
|
|
Hello,
We trying to build the complete Member ship and Role management system in our website and build this functionality into our website for the Admin role rather using the ASP.NET Configuration thats comes default with VS 2005.
In Visual Studio 2005 for any website we can create and manage Users and Roles through the ASP.NET Configuration tool under the "Security" tab. How do I bring the same functionality of the entire "Security" into our website? I.e in other words creating a web page with the same functionality that the "Security" tab has.
Could some one help me to direct me where and how do I start building an Admin page to have all the functionalities like Creating Users, Mangeing Users, Creating Roles and Mnaging Roles, and defining access Rules etc..
Is there an article to go through to understand it?
thanks in advance,
-L
|
|
|
|
|
It's odd that Microsoft didn't include controls for membership management, or a (supported) means for using the ASP.NET management tool for production sites. It may be that's coming along later.
For the time being at least, you can build your own using the methods exposed by the Membership class[^].
Peter Kellner has a good article on this on MSDN (and his own site):
Microsoft ASP.NET 2.0 Member/Role Management with IIS[^] that you might want to check out.
|
|
|
|