How to prevent username field from being changed in the createuserwizard control. asp.net

50 Views Asked by At

Iv been using the built in membership system for asp.net. But I need to make the username field of the createuserwizard unchangeable. I tried using the read only property but apparently that does not work. msdn says to change the property programmability. while that probably works for regular text boxes, there is no read only property from code, it seems. I also tried using the text changed event but that does not seem to actually do anything.

is there a solution?

Thank you.

1

There are 1 best solutions below

0
birddseedd On

I'm not sure if this will solve everyones problem, but since I am controlling the field from code, I can simply remove the markup that adds the validation. It will no longer validate the text box when you click submit, but you are doing that from code anyway. Then you can use read only.