rename .html to aspx - any issues

I already have a working javascript - html5 application on my intranet website ... Default page in that website is index.html

Now, I need  to check who is current windows domain-user logged in. So I am planning  to create ASPX page just to check currently logged in user...  Because in JavaScript there is no way to find out currently logged-in user )  
So I am planning to get userid by using this csharp code -

String username = User.Identity.Name; /// in index.aspx.cs

Now if I change extension of index.html to index.aspx and in index.aspx.cs I write the code above and everything else remains same(like css, javascript code of index.html and other pages)  will my website work in the same way as before
thanks a lot...
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Tom BeckCommented:
I think you just need to wire it up in a directive at the top of the page. Example:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Abstimmung.aspx.cs" Inherits="Schulsprecher.Abstimmung" %>

Open in new window

Of course if you needed to access any of the controls on the page in the code behind you would need runat="server" on those as well to make them HTML server Controls.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ts84zsAuthor Commented:
Yes, i will write everything required for aspx and aspx.cs code

Only concern is if I keep my js, css, html code the same and create index.aspx and index.aspx.cs (with code related to aspx like codebhind etc) and just copy paste javascript/css/html part of index.html into index.aspx will there be any problems as far as look and feel and javascript-functinality of the page is concerned?

thanks so much
Tom BeckCommented: can render plain vanilla HTML pages just fine. Javascript runs on the client so .net is out of the picture at that point.
Determine the Perfect Price for Your IT Services

Do you wonder if your IT business is truly profitable or if you should raise your prices? Learn how to calculate your overhead burden with our free interactive tool and use it to determine the right price for your IT services. Download your free eBook now!

ts84zsAuthor Commented:
what do  you mean by plain vanilla html pages
My html page is like lot of css, divs etc will it be displayed properly?
Tom BeckCommented:
By plain vanilla I mean html pages that do not rely on server side code to generate markup. No matter how much css, or javascript or what html tags you use, if a web browser can interpret that markup now BEFORE you run it through .net, then it will be able to interpret it AFTER you run it through .net. can only act upon markup inside <%> tag blocks, web controls like <asp:TextBox and HTML controls with the runat="server" attribute value. Everything else is passed through "as is".  If the only thing on your page is a directive at the top then everything below it will be passed through to the client browser.
ts84zsAuthor Commented:
ok got it ... thanks a lot
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.