Showing posts with label explorer. Show all posts
Showing posts with label explorer. Show all posts

Wednesday, March 28, 2012

substitute for <span>

asp.net 1.1

for my .aspx web-form , if i set Target Schema = Internet Explorer 5.0 ,
then this line

<span id="NameFirst" name="NameFirst" runat=server></span
causes the error

"the active schema does not support the element 'span'."

what should i use as a substitute for <span> ?That's weird -- span sure is supported by IE5. I can repro your problem only if I switch the schema to IE 3.2/Netscape 3.02 -- in other words, using a schema for a browser before IE4.

For what it's worth, the schema is used for validation in HTML view, but it does not prevent the page from compiling and rendering to the browser. At least, that's my experience while testing this.
Unless you have a good reason for specifying the Target Schema, it would bemuch easier to simply remove that specification. The <span> tag is a very fundamental part of both HTML and ASP.NET, so trying to remove every instance of it would bevery problematic.

However, to answer your question ... you could use a <div> instead.

A <div> is called a "block" element in that each <div> tends to appear "under" the last <div>. (HTML tables are block elements too, as they each generally appear below one another.)

A <span>, on the other hand, is called an "inline" element as each <span> appears "next" to the last <span>. (HTML hyperlinks <a href="http://links.10026.com/?link=..."> are inline elements, as they appear next to the words preceding the hyperlink.)

So, to use a <div> instead of a <span>, you'd need to change it from a "block" element to an "inline" element:

<div id="one" style="display:inline;">...</div>
is pretty much the same as
<span id="two">...</span>

Still, I'd caution again that it would be much easier to remove the Target Schema specification than to try to remove all instances of <span> tags.

Tuesday, March 13, 2012

Switch Off IE (Internet Explorer) Toolbars?

Hi All,

Can anoyone tell me how to:

Switch Off IE (Internet Explorer) Toolbars when my browser windo opens in my application.

crte a button that will close my page

cheers

any help most appreciated

rgs

TonyHi Tony,
You can not do it in current window. You can instead open new window without toolbars and close current. Seethis.
Hi

Thanks for that, just one question...where do I insert in in the asp.net page as I already have script tags with asp.net in them!!!

many thanks

Tony
Hi,

I have use default.aspx that redirects to app mainpage:

private void Page_Load(object sender, System.EventArgs e)
{
string apu = "/Application/AppMainPage.aspx";

string Script = "";

Script += "\n<script language=JavaScript id='StartMainWindow'>\n";
Script += "poppedwin = window.open('"+apu+"','Appmain','resizable=yes, width=1024,height=768,statusbar=no'); \n";
Script += "mainwindow = window.self; \n";
Script += "mainwindow.opener = window.self; \n";
Script += "mainwindow.close(); \n";
Script += "poppedwin.focus(); \n";
Script += "</script>";

Response.Write(Script);
Response.End();
}

I hope this helps.

- Antti -
Hi Tony,
You can insert client script tag anywhere you want (and more then one). Client script tags have no runat="server" attributes and processed differently from server side asp.net script tag.