By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,275 Members | 936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,275 IT Pros & Developers. It's quick & easy.

CreateUserWizard control: forcing it to use a programmatically provided username and e-mail

P: n/a
I am using ASP.NET's CreateUserWizard control. I want to force the visitor
to use a username and e-mail address that I am providing in programming, and
I do not want the visitor to be able to edit the forms input.

I am aware that I can roll my own Create User form by using the membership
API, but I am lazy and want to use most of the CreateUserWizard control's
features.

I tried converting the form to a template and setting the UserName and Email
forms to Enabled="false" and populating their values programmatically. The
client-side validation behaviors prevent this from working: the non-enabled
items get red asterisks on input.

I imagine I could set the value for the names/e-mails in programming
regardless of the user's input, but I want to cue the visitor that they are
not allowed to change these values from what I am specifying.

Suggestions?

Thanks,
-KF

Jun 27 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
A bit more information: ASP.NET does have a "SubmitDisabledForm" boolean
property that can be attached to the form tag for the page. This does not
help with the client-side validation behavior I describe below.

-KF

"Ken Fine" <ke*****@newsgroup.nospamwrote in message
news:44**********************************@microsof t.com...
>I am using ASP.NET's CreateUserWizard control. I want to force the visitor
to use a username and e-mail address that I am providing in programming,
and I do not want the visitor to be able to edit the forms input.

I am aware that I can roll my own Create User form by using the membership
API, but I am lazy and want to use most of the CreateUserWizard control's
features.

I tried converting the form to a template and setting the UserName and
Email forms to Enabled="false" and populating their values
programmatically. The client-side validation behaviors prevent this from
working: the non-enabled items get red asterisks on input.

I imagine I could set the value for the names/e-mails in programming
regardless of the user's input, but I want to cue the visitor that they
are not allowed to change these values from what I am specifying.

Suggestions?

Thanks,
-KF
Jun 27 '08 #2

P: n/a
OK, this ranks in the "duh" department, though the information I provided in
my last message regarding the SubmitDisabledForm property may be useful for
someone in the future.

To deal with the issue I describe below, convert the CreateUserWizard
control to a template, and simply go into the source and strip out the
RequiredFieldValidator controls from the controls that you are making
mandatory defaults.

-KF
"Ken Fine" <ke*****@newsgroup.nospamwrote in message
news:44**********************************@microsof t.com...
>I am using ASP.NET's CreateUserWizard control. I want to force the visitor
to use a username and e-mail address that I am providing in programming,
and I do not want the visitor to be able to edit the forms input.

I am aware that I can roll my own Create User form by using the membership
API, but I am lazy and want to use most of the CreateUserWizard control's
features.

I tried converting the form to a template and setting the UserName and
Email forms to Enabled="false" and populating their values
programmatically. The client-side validation behaviors prevent this from
working: the non-enabled items get red asterisks on input.

I imagine I could set the value for the names/e-mails in programming
regardless of the user's input, but I want to cue the visitor that they
are not allowed to change these values from what I am specifying.

Suggestions?

Thanks,
-KF
Jun 27 '08 #3

P: n/a
Hi Ken,

Thanks for sharing your solution with us.

As for the Email field in CreateuserWizard, you can also consider set the
TextBox to readonly mode (via the "readonly" html attribute). e.g.

======
<asp:TextBox ID="Email" runat="server" onload="Email_Load"
readonly="true"></asp:TextBox>

==========

Thus, you can still programmtically assign value to the TextBox and the
value will be posted back when form is submit(validator will work correctly
with it).

Hope this also helps.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsoft.com.

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
>From: "Ken Fine" <ke*****@newsgroup.nospam>
Subject: SOLVED i think Re: CreateUserWizard control: forcing it to use a
programmatically provided username and e-mail
>Date: Tue, 29 Apr 2008 12:49:11 -0700
>
OK, this ranks in the "duh" department, though the information I provided
in
>my last message regarding the SubmitDisabledForm property may be useful
for
>someone in the future.

To deal with the issue I describe below, convert the CreateUserWizard
control to a template, and simply go into the source and strip out the
RequiredFieldValidator controls from the controls that you are making
mandatory defaults.

-KF
"Ken Fine" <ke*****@newsgroup.nospamwrote in message
news:44**********************************@microso ft.com...
>>I am using ASP.NET's CreateUserWizard control. I want to force the
visitor
>>to use a username and e-mail address that I am providing in programming,
and I do not want the visitor to be able to edit the forms input.

I am aware that I can roll my own Create User form by using the
membership
>API, but I am lazy and want to use most of the CreateUserWizard
control's
>features.

I tried converting the form to a template and setting the UserName and
Email forms to Enabled="false" and populating their values
programmatically. The client-side validation behaviors prevent this from
working: the non-enabled items get red asterisks on input.

I imagine I could set the value for the names/e-mails in programming
regardless of the user's input, but I want to cue the visitor that they
are not allowed to change these values from what I am specifying.

Suggestions?

Thanks,
-KF

Jun 27 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.