How to concatenate string in password.aspx file ?
Hi, For my domain i want to concatenate automaticaly *DOMAIN* + username in password.aspx file :
Because many of my users dont write DOMAIN\ and its very boring ! ive already add a value like value="DOMAIN" in the input form but when i put a value, my user DONT write username... so i want to concatenate Its possible ? Regards,
ASP.NET
Remote Desktop
-
Jiale Xue - MSFT • 48,691 Reputation points • Microsoft Vendor
2024-02-23T02:30:00.3666667+00:00 Hi @GOUJON Thomas , Welcome to Microsoft Q&A, I'm not quite sure what type of project you have. From your screenshot it looks a bit like RD Web. Does password.aspx file refer to an Asp.net project? Please clarify.
-
Thg • 0 Reputation points
2024-02-23T07:18:48.0333333+00:00 Hi, you are right ! ive tried this one but it doesnt work :
if ( objQueryString["UserName"] != null ) { DomainUserName.Value = "DOMAIN\\ + "SecurityElement.Escape(objQueryString["UserName"]) ; }
-
Jiale Xue - MSFT • 48,691 Reputation points • Microsoft Vendor
2024-02-23T07:22:08.7+00:00 Hi @GOUJON Thomas , I don't understand which one you are referring to specifically. Using the correct tags can allow relevant people to help you solve the problem. Please clarify again.
-
Thg • 0 Reputation points
2024-02-23T07:31:33.6033333+00:00 ok sorry. Ive tried this one in password.apsx :
if ( objQueryString["UserName"] != null ) { DomainUserName.Value = "DOMAIN\\"+SecurityElement.Escape(objQueryString["UserName"]) ; }
-
Thg • 0 Reputation points
2024-02-23T07:37:41.4466667+00:00 Ok, so tell me which file do you want to clarify my request ;)
-
Lan Huang-MSFT • 30,086 Reputation points • Microsoft Vendor
2024-02-23T08:16:26.7833333+00:00 Hi @Thg, What problems are you currently experiencing? The second method you provided should work. Can you provide the results your code renders?
-
Thg • 0 Reputation points
2024-02-23T08:24:19.1233333+00:00 Hi, im not developper. so, when i try to concatenate DOMAIN+username in the code, like me example above, it doesnt work and i have an error "invalid username..."But, when i write in the text input DOMAIN\username thats work.
-
Lan Huang-MSFT • 30,086 Reputation points • Microsoft Vendor
2024-02-23T09:28:37.74+00:00 Hi @Thg,
There should be no problem with string concatenation. You'd better breakpoint and check if the value returned by SecurityElement.Escape(objQueryString["UserName"] is correct.
You can breakpoint and check if there are any differences between the manually entered value and the connected value.
-
Thg • 0 Reputation points
2024-02-23T09:35:56.5733333+00:00 ok, how to do this? How to breakpoint ? i change the file with notepad++ I must restart the server for many update?
-
Lan Huang-MSFT • 30,086 Reputation points • Microsoft Vendor
2024-02-26T02:31:22.0233333+00:00 Hi @Thg, Restart the server? Is your project an ASP.NET Webform project? Based on your problem description, you should want to change the domain prefix from the RD Web Access page. If yes, I think you should post with
Remote Desktop
tag for help. -
Thg • 0 Reputation points
2024-02-26T10:27:55.2+00:00 Yes, right, tis is an ASP.NET project
-
Lan Huang-MSFT • 30,086 Reputation points • Microsoft Vendor
2024-02-27T06:04:59.9866667+00:00 Hi @Thg, Could you try running your project using Visual Studio? Debugging your code is easier with Visual Studio.
-
Thg • 0 Reputation points
2024-02-27T07:57:58+00:00 Yes no problem. but i dont know how to do this. I have my web folder on my desktop :
-
Thg • 0 Reputation points
2024-03-04T07:48:31.84+00:00 Hi,
Anyone? thanks :)
-
Thg • 0 Reputation points
2024-03-13T09:53:36.1+00:00 Anyone please ?
Sign in to comment