Random code sequence being generated in my URL [duplicate] - c#

This question already has answers here:
How can I remove the ASP.NET Session ID from my URL?
(2 answers)
Closed 6 years ago.
I've recently developed a web a pplication. Specifics arent necessary. My issue is that whenever i start up my project, it generates a random code sequence, just before the name of my page.
http://localhost:53655/_Beta_Webiste/(S(sbjvzcdbbugovmuzvdt25scm))/administrator.aspx
As you can see, it is this random piece here
(S(sbjvzcdbbugovmuzvdt25scm))
Now it always starts with an (S("Random code here")). Always starts with an S. Does anyone know what the issue is here, as it can lead to confusion with the customers. Also please not that if i even just type
http://localhost:53655/_Beta_Webiste/administrator.aspx
It will still generate that code. (It does this for all links, even when i hover over my Href's. Help is greatly appreciated.

It is not an issue.
Your website using "Cookieless" environment (specified in web.config).
You can find <sessionState cookieless="true" /> in your web.config file. Just make it false or remove completely (default value is false).
You can get more details about it from here.

Related

What should I use to open windows explorer in different positions? [duplicate]

This question already has answers here:
Opening process and changing window position
(3 answers)
Closed 3 years ago.
I recently posted this question but didn't get any response on it:
Need help opening 2 windows explorer windows to two different spots
I still would like any help that can be given in this case. One thing that I thought might have been confusing about my previous post is that both of the examples I noted were using SetWindowPos. I really don't care about the method used to solve this problem only that A) it uses c# and B) that it meets the desired criteria as posted in my previous post. Please, if there is further clarification needed please ask me. Thanks!
Use a mouse. Click the corner of the window and drag it until it is the desired size.

Variable in c# resource [duplicate]

This question already has answers here:
Why are persisted user settings not loaded?
(2 answers)
Closed 7 years ago.
I am working on a project and I need a kind of variable that save the value and after restarting the program, the value won't get refresh.
For example:
Home Page of a web browser that when you change it, it will save and after restarting the application, it won't reset to the first Home Page Address.
I thought that I can do it using application properties settings
Properties.Settings.Default.
But it didn't work.
If the setting is application wide, and not per user, you can use the AppConfig to store the value. A similiar question was asked here.
Sample code copied from Amol M Kulkarni:
Configuration config = ConfigurationManager.OpenExeConfiguration(Application.ExecutablePath);
config.AppSettings.Settings.Add("YourKey", "YourValue");
config.Save(ConfigurationSaveMode.Minimal);

Asp and WebClient: How to get dynamically actual host? [duplicate]

This question already has answers here:
How to get "Host:" header from HttpContext (asp.net)
(4 answers)
Closed 8 years ago.
I want to get datas from an html file on my asp webserver, in Javascript to get actual host we can use the following:
~/mydatas.php
It gives on localhost: "http://localhost/mydatas.php"
I want the same thing but in C# can you help me?
Thanks you.
You could also search in stackoverflow and you will find a lot of answered question which had the same problematic than you. Like this one
Hopes it will help you !
Edit : You can use
HttpContext.Current.Request.Url.AbsoluteUri
It will give you the URL of your web page.
I've already try
HttpContext.Current.Request.Url.Host
which gives on localhost
:\windows\system32\inetsrv\localhost
...

URLs like on a visualstudio.com - advanced routing? [duplicate]

This question already has answers here:
Is it possible to make an ASP.NET MVC route based on a subdomain?
(10 answers)
Closed 8 years ago.
I'm writing here becouse one question doesn't let me sleep calmly. How it's possible that site www.visualstudio.com when I sign in to free TFS account, create special 'part' of site with url {myprojectname}.visualstudio.com?. Is it achieveable in my project using ASP.NET MVC 4 or 5? How it doesn't affect in current DNS system? or it affect? What should I read to let my site be so deeply customizable?
for example:
user1.mysite.xx
user2.mysite.xx/aaa/4/sda/something_other
The easiest way is to define a wildcard DNS A or CNAME entry like (BIND syntax):
*.myside.xx. IN A x.x.x.x
In Windows you can use the command line dns tool for it: http://support.microsoft.com/default.aspx?scid=kb;en-us;840687
After that regardless what you write as username.myside.xx it will hit your webserver. From your code you can decide what to do, make a redirect to username.myside.com/username or whatever else

Adding a separate file for all website content [duplicate]

This question already has an answer here:
Getting text from the Resource file in asp.net 4
(1 answer)
Closed 8 years ago.
Thank you in advance for your help.
I have a website in asp.net and c#, i need to have it that all text that is in the site should be taken from a separate file, so it can be changed easily if needed, and for other similar reason.
Hope this id clear.
What is the best way of doing such a thing?
You'll want to read up on resource files, globalisation & localisation. There is a binding expression, similar to <%# that can read the values from the resource files.
This should get you started: http://msdn.microsoft.com/en-gb/library/fw69ke6f.aspx
Simon
I would be tempted to keep your solution 'un-compiled' and then use resource files.

Categories