Forums: Front End:

 

Visual Studio 2005 / ASP.NET Question

first
 

JimmyTheGent Visual Studio 2005 / ASP.NET Question

My work have recently been putting me through a lot of courses on c# and ASP.NET using Visual Studio 2005. Before I have been used to working with sites which use XHTML/CSS/PHP so a lot of this is new.

before I would just use Notepad++ to write the markup and CSS. Now because I am using Visual Studio 2005 I am worried my CSS / markup is going to be messy.

Using the toolbox in visual studio, I can drop the objects in via source view so I dont need to use the default inline styles which I understand, but then if I apply a cssstyle to them via the properties of the object it doesnt seem to work when viewed in browser even though it looks right in the design view.

Does visual studio 2005 force you to use inline styles and tables? i stopped using tables for layout a long time ago when i got the hand of divs, seems weird to go backwards....

Like I said, I am new to the applications is there a funamental I am missing?

Thanks Folks

JTG

 

jamiec

No, VS does not force you to do anything. Just carry on as you were doing and write the markup using the code view rather than the crappy designer (which is shite and for amateurs!)

If you're used to coding PHP you'll soon find writing ASP.NET dreamy - its just abit of a steep learning curve!

For layer-based layout you can eather use the div/span tags your used to, or if you want server-side interaction use asp : Panel (which is rendered as a div tag) and you assign a css class using the CssClass property.

<asp: Panel id="pnlMyLayer" runat="server CssClass="someCss">
some stuff here
</asp: Panel>

Stylesheets can still be externalised in exactly the same manner. Remember that asp.net does not fundamentally change anything about how a web app works, its just one huge great big wrapper around rendering HTML and handling events in a stateless environment to make them act like a stateful environment (like a windows app).


 

JimmyTheGent

Thanks for the advice.

I will just knuckle down and keep doing XHTML / CSS in code view as before and then fit the controls in. Just when i looked at other .NET sites they ALL seemed to use tables... made me think "Yuk".

Thanks again and happy new year. I will keep the learning going smile

 

Hideaway

To add, about the only time you're limited to tables is when using the built in controls like GridView, DetailsView, Calendar, the log in controls and of course the Table control.

I think it would be a nice add to set the render-type of the control to DIV or TABLE. But Jaime pretty much nailed it.

I love boots. It's like midgets hugging my calves...
quote
 
first
 

Forums: Front End: Visual Studio 2005 / ASP.NET Question

 
New Post
 
You must be logged in to post