|
Thanx Friend
I am able to format the 'Money' data in the grid.
But i need to restrict the user from entering incorrect format.
For example,if he wants to enter '1244566.87' or '1244566',either of these should be allowed..
The whole number part(here '1244566') of maxlength as 8 characters and that of digits after decimal point(here '87') of 4 chars in maxlength.
Can anyone help me?
|
|
|
|
|
Let me get this straight..
You want to the user to input data which is from 1-8 character long AND 1-4 decimal places?
So the user CAN input: 12345678.1234 // 1.1 // 1 // 12345678 // 1.0
and CANNOT input : 0.1234 // 123456789 // 0
If that is correct, then just go to the website (http://regexlib.com/DisplayPatterns.aspx) and look for the correct regular expression for it. When you find the espression, use a <asp:RegularExpressionValidator>.
The thing is, I don't have the time to search for you. I did not have the same conditions as you did. I am trying to meet a deadline myself. Hope you find your answer.
|
|
|
|
|
Thanks very much!
I got through my problem and its working fine now...
I have written the validation expression already.
I had a little problem over there and i rectified it now..
Thanx!!!
|
|
|
|
|
Hi guys
I need to use user control in ASP.net(1.1). Before using the control, I thought to desing one small sample to see in/out of usercontrols. I am facing very basic problem and appreciate your help. Please note I am using VB.net as code behind language.
I need to access user control text box values on click of web form Submit button.....
Code Steps at ASCX
--------------------
1)Created a user control LoginControl.ascx with two text boxes as TextBox1 and Textbox2 for name and password.
2)Created two properties _Name and _Password
Code Steps at Webform
-------------------------
a)On the same project created a new web form
b)Drag the ascx control
c)Declare public variable Dim objUser As New LoginControl
d)On Page load objUser = New LoginControl
e)And on click of Web Form (Submit Button)
objUser.Name = CType(objUser.FindControl("TextBox1"), TextBox).Text
objUser.Age = CType(objUser.FindControl("TextBox2"), TextBox).Text
Me.Label1.Text = objUser.Name
Me.Label2.Text = objUser.Age
Statement e is giving object reference is nothing error.......
PLEASE HELP
Amit
|
|
|
|
|
I believe that the id of the user control declared on the web page by default is something like LoginControl1 , not objUser . VS 2003 basically does not automatically add the declaration of the web user control for you, and you'll have to manually do that with one note that the variable name must be the same as the id of the web user control after you drag onto the web page. Something looks like:
Protected WithEvents LoginControl1 As LoginControl
Also, you should expose the values of the child textbox controls via the two public properties that you already define in the user control. And from the web page, you simply get the textboxes' values via the user control's properties.
|
|
|
|
|
thanks. Can you share some sample source code. (VB.net)...Thanks in advance.
|
|
|
|
|
Public Class LoginControl
Inherits System.Web.UI.UserControl
#Region " Web Form Designer Generated Code "
...
#End Region
Public Property Name() As String
Get
Return txtName.Text
End Get
Set(ByVal value As String)
txtName.Text = value
End Set
End Property
Public Property Password() As String
Get
Return txtPassword.Text
End Get
Set(ByVal value As String)
txtPassword.Text = value
End Set
End Property
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
End Class
|
|
|
|
|
Hello,
I am creating a Poll system and I need to check if a user has already voted.
What should be the best way to do this?
1. Should I save the user IP along with its vote in the database?
But does not some users IP change each time they access the internet?
2. Should I place a cookie in after the user voted?
Well, any help will be great.
Thanks,
Miguel
|
|
|
|
|
If this is for authenticated users only, then you could always associate the vote and the users. If everybody can vote, then you should use cookies.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Hey every one.
I have a webpage with server-side controls that are validated on the server side, however this is costly so i would like to perform some of the validation on the client side (using javascript).
How do i go about performing the validation on the client side.
I have tried changing the control to for example but the page doesnt load and i am informed this is an invalid attribute.
Is this possible and if so how do i go about it?
Thanks
Dan
|
|
|
|
|
Use the ASP.NET validator controls.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
The other best way can be use Java Script. You can
a) Create Js files
b) And Add JS to control by using Attributes.ADD property. FYR i am attaching one sample code
btnSubmit.Attributes.Add('OnClick',"javascript return MyMsg();")
And here is JS
function MyMsg()
{
Alert("I am fine");
}
Thanks
Amit
Amit
|
|
|
|
|
Hai,
I am working for project regarding software request where user will submit request for software over online.After user submitting the form ,the software should be installed on the user system but it should not be download able.I am planning to use wpkg software which will be useful for implementation of software installation online over windows workstations.So can anyone give me the rough sketch if i need to implement for all types of workstation.
How can we implement software installations over online using asp.net?
Please can any one help me out with an idea???
Thank you,
Veerendra
|
|
|
|
|
Please don't repost. You posted this 13 hours before this one. The people who help on this site will get to you if they can, and if they think they can help.
Your question isn't clear, and this doesn't help.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I'm creating a .NET crystal report sales report that lists the total # of each item sold and the percentage of total sales that the item contributed towards however, before I can calculate the percentage for each row, I need to know the total qty of the report, which I don't know how to retrieve.
So a sample report of 500 items sold may look like this:
-----------------------------------------------------------
Category | Qty Sold | Percentage
-----------------------------------------------------------
Electronics | 200 | 40%
Books | 100 | 20%
Movies | 150 | 30%
Games | 50 | 10%
-----------------------------------------------------------
Total | 500 | 100%
-----------------------------------------------------------
How can I calculate a percentage for something like this?
Thanks.
-Goalie35
|
|
|
|
|
i've been working with ASP.NET for the last 2 years. But the problem is that i've never had any strategy for designing. I'm the only ASP.NET programmer in my office and b/c of that i never bothered to follow any of the design framework. Eventhough i know uml & OOAD, i would just create a few UML diagrams and then jump right into programming. I was wondering if anybody could recommend any books or articles that would enlighten me on how to create an ASP.net application by walking through each of the design, analysis & testing steps. Please help me with your advise. Would greatly appreciate your help.
|
|
|
|
|
Well, i guess i can help u with this i have pdf's and many examples about UML diagrams.
Requirements, Analysis, Design, Implementation, and testing.
Estarta
|
|
|
|
|
Hi,
I would also like to have a look at the PDF's.
Can you please share the same with me too..
Thanks in advance
Renu.K
Renu.K
|
|
|
|
|
|
okay i used Speedyshare you can download the files using these links
http://www.speedyshare.com/273390375.html
http://www.speedyshare.com/833568875.html
http://www.speedyshare.com/474971886.html
http://www.speedyshare.com/868601417.html
hopefully this is what you looking for.
Regards
Estarta
|
|
|
|
|
"Someone has asked me to put this question in asp.net Forum. So, please make sure this is NOT DOUBLE Posting"
Hi all. I have a textbox in which i will add "Comments" on aspx page along with an Add button. On this page , i have a gridview as well. The problem is,
When i enter value in TEXTBOX and press ADD button, the value in textbox should have to be populated in Gridview without PAGE REFRESH. Please make sure the current scenario.
I have a table ABC with a column Comments. I have to pull Data from ABC table in Gridview. so, when i add value in Textbox and press add button, basically it will save first in ABC table and then refresh the gridview behind the scene. Please let me know How I can achieve it. Thanks for your consideration
|
|
|
|
|
Your best bet would be to use some AJAX framework. We have purchased the telerik controls, so that is a piece of cake. You could probably accomplish this with ASPNet AJAX which is free.
|
|
|
|
|
You can implement ICallbackEventHandler interface in your webpage and use client-callbacks to call the server when the Add button is pushed sending the text to be added as a param.
You'll find the details on how to accomplish that here: http://msdn2.microsoft.com/en-US/library/system.web.ui.icallbackeventhandler.aspx
Then, on the server side in the RaiseCallbackEvent method, add the text to the grid and render the grid to a StringWriter like this:
StringWriter stringWriter = new StringWriter(CultureInfo.InvariantCulture);
HtmlTextWriter htmlWriter = new HtmlTextWriter(stringWriter);
yourGrid.RenderControl(htmlWriter);
htmlWriter.Flush();
htmlWriter.Close();
string result = stringWriter.ToString();
You have to send back the result to the client side where you have to replace the outerHTML of the grid with the data you recive from the server. Your javascript function that recives the callback result and does the replacement should look something like this:
function __onServerCallback(result, gridID)
{
else if (result.length)
{
// set the resulted data to the grid
var grid = document.getElementById(gridID);
grid.outerHTML = result;
}
}
I hope this will help and I'm sure you will find good articles related to this subject on codeproject. Just search for ICallbackEventHandler.
Sebastian M.
|
|
|
|
|
How can we know that Excel is installed on a PC using ASP.NET 2.0??
Thanking you in advance..
Zyaad
|
|
|
|
|
In ASP.NET 2.0, you can add a reference to the "Microsoft Office 11.0 Control Library" dll.
There may be something within that object that can achieve what you're looking to do. The only catch is I believe it's only compatible with ms office 2003 or higher.
-Goalie35
|
|
|
|