|
Hi All,
I have a query regarding validating some server controls inside a repeater with the help of validation summary control .(The project is in asp.net 2.0 with C# as scripting language).
Actually the repeater gets bond as follows:
We have dynamic number of users(not more than 4). As per the number of users, that many items get repeated in the repeater.
There are some requiredfield and regularexpression validators inside the repeater to validate some textboxes,dropdownboxes,etc... inside the itemtemplate of the repeater.
The validationsummary control is placed out side the whole declaration of the repeater.
The validations do get fired perfectly, but the problem is that I have to display the fired validations userwise.
For e.g. imagine there are three required validators for name,email and phone & two regularexpression validators for email and phone.
If three users are bound in the repeater, then the validation summary should look like:
User 1:
- Please enter name
- Invalid email.
User 2:
- Invalid phone.
User 3:
- Please enter phone.
- Invalid email.
So how can i assign the text of User1, User 2 & User 3 in the message of validation summary (Please remember that the users are dynamic, upto 4 users can come in the repeater). Is there any way to assign the header texts of the validation summary in this manner?
It can be done in the itemdatabound of the repeater as per my thinking but I am not able to find as to how to do it.
The validation summary declaration (outside the repeater) is as below:
<asp:validationsummary id="ValidationSummary1" runat="server" font-size="X-Small" showmessagebox="true" showsummary="false">
Can anyone please show me a solution for this.
Thanx a lot for the patience to read it.
Kushan Shah,
Web Developer.
|
|
|
|
|
Hi All,
Atlast I have done the below code in the repeater's Itemdatabound(although it can be said somewhat as patch management), but it is working at present:
((RequiredFieldValidator)e.Item.FindControl("reqfav_Phone1")).ErrorMessage = "Custodian" + ind.ToString() + ":" + " " + ((RequiredFieldValidator)e.Item.FindControl("reqfav_Phone1")).ErrorMessage;
where ind.tostring() is a server control where in we show 1/2/3,...... (User 1,User 2,User 3,...........).
We have done this thing for all the validators required/regular; which were inside the repeater.
And also the display of messages is altered a bit, now the errormessages (in validation summary) look like:
User 1: Please enter email.
User 1: Please enter phone.
User 1: Invalid email.
User 2: Please enter name.
User 3: Invalid phone.
Please let me know if anyone gets a better solution for this.
|
|
|
|
|
i m devloping web mail client . mail is sending properly.but how to recive mail on my web mail client .
-- modified at 7:10 Thursday 25th October, 2007
|
|
|
|
|
Your web mail client is irrelevant. You need to write the code to recieve POP3 mail, the web part is just how you render the mail you have recieved.
As is often the case, my first google hit was on this site:
http://www.codeproject.com/cs/internet/despop3client.asp[^]
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 )
|
|
|
|
|
Hello guys.
I have a web pages in aspx and others in html, but the problem is my aspx cant link to the html pages.I get this error "The HTTP verb POST used to access path '/Search AL/AL Intranet - IT Department.htm' is not allowed".
Is there a specific reason why??
Thanx in advance.
kagiso
|
|
|
|
|
It's a problem with the configuration of your server. It's always worked fine for me. How are you linking, with just an HTML link, or with a Response.Redirect, or what ?
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 )
|
|
|
|
|
I have a button with a simple response.redirect.Ive never been able to do so and I have not yet uploaded the pages onto the server yet.Im testing them from my machine which should not be a problem.
kagiso
|
|
|
|
|
I'm guessing you static pages are in the same virtual directory as the application?
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Yes.I cudnt afford to make that mistake again but yes.
I created the link by using the properties of the button and finding the postbackURL and following finding the page I want to link to.Since they are in the same directory I cud see them.
But clicking to link I get that same error message.
kagiso
|
|
|
|
|
You're most probably having a problem with IIS. There is a this[^] diagnostics utility from Microsoft. Maybe it will give you more details about the problem.
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Linking to a page doesn't case a POST request to be sent. It will send a GET request. What do you do to get to the page?
The built in web server in Visual Studio doesn't support POST requests to html files, only GET requests.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
On the properties window, there is a PostBackURL property for my button, so I selected the link to the page I want to open when the click event is passed.
There is a property called OnClientClick, do I need to tell it to do something there??
kagiso
|
|
|
|
|
The PostbackURL property is used to do cross page postbacks. You can't postback to a html page.
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 )
|
|
|
|
|
Ok, now Uve got my attention, so how do I go about doing this.I need to show the html page when the click event is carried out.
kagiso
|
|
|
|
|
Why don't you just link to it?
<a href="...">name </a>
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
If you're going to a html page, you don't need a server control at all. Just render a button and do a redirect on the client side in javascript when the button is pressed. That saves the server trip altogether.
Another solution is to handle the click event and do a response.redirect in the code behind.
The point of the property you're trying to use is that viewstate from the current page can be passed to another page. The error is telling you that it thinks you're trying to pass viewstate to a html page, which is what you can't do, an html page will not be processed on the server, so there can be no viewstate.
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 )
|
|
|
|
|
So how do I got about posting back to a html page??
That is the question.
Thanx in advance.
kagiso
|
|
|
|
|
matjame wrote: So how do I got about posting back to a html page??
You don't.
An html page doesn't process the post data, so there is no reason to use a post request to go to the page.
Just use a regular, simple html link.
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
Nothing happens when I use linkbuttons.I still cant access the pages, so I tried using
Protected Sub imgContacts_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs) Handles imgContacts.Click
Server.Transfer("AlrodeMaps.aspx?") ' this moves to a new pagie
End Sub
and I get an error "cant be rendered".I think this mite work but not sure if I need any further configurations.
kagiso
|
|
|
|
|
matjame wrote: Nothing happens when I use linkbuttons.
"Nothing" actually very rarely happens. What exactly happens?
matjame wrote: I still cant access the pages
Have you tried to write the url directly in the browser, or using a ordinary html link?
matjame wrote: Server.Transfer("AlrodeMaps.aspx?")
You can only make a transfer to another aspx page, not to an html page.
matjame wrote: I get an error "cant be rendered".
Could you be more specific about the error message? What is the exact error message? Does it come from the server or the browser?
---
"Anything that is in the world when you're born is normal and ordinary and is just a natural part of the way the world works. Anything that's invented between when you're fifteen and thirty-five is new and exciting and revolutionary and you can probably get a career in it. Anything invented after you're thirty-five is against the natural order of things."
-- Douglas Adams
|
|
|
|
|
CMS is a standard name that describes systems that can manage the content. There's no great mighty CMS out there everyone is using. You're mo0st probably using a custom solution. How should we have documentation for that? Ask your colleagues/project manager for it.
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Hi i am currently displaying my crystal report in my page itself...,
But i like to show that in popup window...,
Its any possible way is there to do?,
Advance thanks,
Regards,
Magi
|
|
|
|
|
The popup window is stil a window ain't it? It's just that it's resized.
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Hi all
I want to know whether the session id is unique when a group of people browsing through the same site, same page at the same time.
Can anybody help?
Please send me the code which will generate the session id so that i can use the same id number to create a folder in my application.
-- modified at 5:50 Thursday 25th October, 2007
Prakash Mishra(Banglore,India)
|
|
|
|
|
Yes Seesion Id is unique for every user....
Arun Singh
Noida.
|
|
|
|