|
Use a CustomValidator control and use the ClientValidationFunction to check all fields you are interested in.
only two letters away from being an asset
|
|
|
|
|
Hello Mark,
I posted an updated question that may be clearer than my original question.
Here it is...
Is there a way to validate several fields on a form with ONE validation control?
The scenario - 10 fields, at least one of them needs an entry before proceeding to the next page.
I need to check if all fields are null (empty, blank) and return an error message
I just checked out the ClientValidationFunction but it seems(to me) that I can still only validate against one field at a time. Is that true or do you think I can use this function to validate against multiple fields with ONE validation control?
Thank you for your earlier response.
Patrice
|
|
|
|
|
...ClientValidationFunction to check all fields you are interested in.
only two letters away from being an asset
|
|
|
|
|
I'll look at it again. Thank you so much.
Patrice
|
|
|
|
|
hi..
i want to know that how the child controls of custom server control(.ascx) will be rendered ,while we are using in application.
If people around u, r tring to pull u down,
be proud abt it! it only means one thing :
"U r above them"
|
|
|
|
|
What do you mean, how will it be rendered. Your question makes no sense.
only two letters away from being an asset
|
|
|
|
|
What? I could not able to get clear about your question?
Regards,
Satips.
|
|
|
|
|
Hi,
I am trying to extract a method from my code & I keep getting an error message saying 'The refactoring could not be peformed due to build errors'.
but I do not have any build errors & I can run the app no problem.
I am using Visual Studio 2005 Team Edition for Software developers
Has oneone got any ideas?
Many thanks
Janet
-- modified at 9:09 Friday 8th June, 2007
|
|
|
|
|
I have fixed this by...
Closing down my project & re-opening!
|
|
|
|
|
How to create and use assemblies in .net? can anybody explain me how to use assemblies?
|
|
|
|
|
|
in .net .exe & .dll files are known as assemblies
and u can make .exe by creating a windows application or console application etc..
and u can make a .dll by creating a class library
|
|
|
|
|
Add the the Assembly you want to use as a reference to your application and include its namespace and use it .....
If you want to create a assembly it depends on which tyoe of application are you devloping
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... "
|
|
|
|
|
Thanks,
Can you tell me how Version and Strong name actually works?
|
|
|
|
|
I have three pages: First.ascx, Second.ascx and Third.ascx
In First.ascx, im setting a session variable to some value
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Session("xyz")="SomeValue"
End Sub
In Second.ascx, i have a function to access the session value
Public Function RetrieveFromSession() As String
Dim str As String
str=Session("xyz")
return str
End Function
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim SessionValue As String
SessionValue = RetrieveFromSession()
End Sub
This is working perfectly fine. Im able to access the session this way.
But in Third.ascx, im creating an instance for Second
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim objSecond As New Second()
Dim strSessionValue As String
strSessionValue = objSecond.RetrieveFromSession()
End Sub
The function RetrieveFromSession() is called properly, but inside the function
the line str=Session("xyz") goes to error. It says "Object reference not set to an instance of an object."
But, im able to access the session directly. ie.,
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim strSessionValue As String
strSessionValue = Session("xyz")
End Sub
This is working fine.
But, i want third.ascx to access the session using objSecond.RetrieveFromSession() function.
How can this be rectified.
Can anybody help me in this regard???
Ashokkuma
|
|
|
|
|
Hi,
Your approach is not correct. and it won't work at all.
When u set session value it will be accessible from current objects of all the ascx.
Here u r creating new object of second. When u do this a new session will start for that instace and that new session will not have any value obviously and that's why it is giving you error.
Its better that you access your session value by conventional way.
and I dont understand why you want to go by "objSecond.RetrieveFromSession()" this way.
Is there any specific requirement?
Thanks and Regards,
Chetan Ranpariya
|
|
|
|
|
Hi Chetan,
Thanks for your quick reply.
The reason for me to use objSecond.RetrieveFromSession() method is,
i want Third.ascx to perform an operation which is already done in a function in Second.ascx.
I dont want to write the same function again in Third.ascx.
I want to use the function which is already there in Second.ascx.
Since the function is accessing Session, it throws error.
Can u suggest any other way to do this without copying the same function from Second.ascx to Third.ascx.
Thanks & Regards
Askokkuma
|
|
|
|
|
Create a class to access your session objects if this is what you require and reference this class from your pages. It's not good practice to have your aspx pages referencing each other in this fashion.
|
|
|
|
|
why don't u make a base class and derive your second and third class from that class
and in your base class u write the code to read the session
|
|
|
|
|
When you create an instance of a page class yourself, it's just an instance of a class, it's not connected to anything. If you call any methods in the object, it won't be able to use anything that is normally available in a page.
Put any code that you want to reuse in a separate class, and use that from both pages.
---
single minded; short sighted; long gone;
|
|
|
|
|
Hi,
Thank you all for your valuable suggestions.
I used the following code in the function objSecond.RetrieveFromSession()
before accessing the session.
Dim Session As System.Web.SessionState.HttpSessionState
Session = HttpContext.Current.Session
It worked. Now im able to access the session value this way by referring the current session variable.
Now i got two more problems in the same function objSecond.RetrieveFromSession()
1) Im not able to access the viewstate values of the base page. How can i access the viewstate through this function?
2) In my Login page ,i have set
FormsAuthentication.SetAuthCookie(strUserID, False)
Now, im not able to access the value by using
Page.User.Identity.Name.ToString() in the function objSecond.RetrieveFromSession()
But in the base page im able to acces it directly.
Plz suggest some way to solve this.
|
|
|
|
|
Hi in my datagrid i am using data formatting expression for the boundcolumn{0:N} like...,
So after decimal its giving two digits...,
Now i try to store the value in my table...,
so using this code i get the value & try to store in my table:
For Each MainGRD As DataGridItem In Me.dgrdmain.Items
Dim Hra As Decimal = Val(MainGRD.Cells(10).Text)
...
//here using store procedure i try to store the value in my table
Next
But if the value will display like: 14,567.87
then its store only 14 in my table...,
If i remove data formatting expression...,
Then its store full value to my table like 14567.875432 like...,
Plz i want the solution how to store the proper value with data formatting expression to my table...,
Plz any solve my probs....................,
Magi
|
|
|
|
|
one dirty way of doing that
u can change the datatype of your sql field to string/varchar (if it is not string)
|
|
|
|
|
Hi all...
Here i read xml from a string and i kept in a data set
Dim myDS As DataSet = New DataSet
Dim myTable As DataTable = New DataTable("DOList")
myTable.Columns.Add("OtherData", Type.GetType("System.String"))
myDS.Tables.Add(myTable)
Dim xmldata As String = strXMLString
Dim xmlsr As StringReader = New StringReader(xmldata)
myDS.ReadXml(xmlsr, XmlReadMode.IgnoreSchema)
next i have to read that xmldocument and i need to get some node .but i am not getting hoe to retrieve that xml document in data set can u please help me.
Suresh.R
|
|
|
|
|
your question is not clear....
you asked in the subject line
sooreeagt wrote: how to get the xml from dataset
but inside you explained sth else
pls explain it properly
Regards,
Sylvester G
sylvester_g_m@yahoo.com
|
|
|
|