|
Simple CSS ? No such thing.
CSS: great idea, lousy implementation.
IMHO.
Fred
|
|
|
|
|
I am quite new to the environment and seem to have goofed myself up someplace, so any help is appreciated.
I have form1 - form1.aspx, if I double click a button to add code, VS opens form1.aspx.vb, then I had form2, same deal, double click a control to edit code and get form2.aspx.vb. Then one day I was tweaking a bit of formatting and now when I double click a control on form1, it opens form2.aspx.vb
What in the world did I do to deserve this? Any ideas what I did?
Mike
|
|
|
|
|
Check your "Inherits" and "CodeFile" attributes of the ascx page - thay may be pointing in the wrong directions...
"Knock me down, I'll get straight back up again, I'll come back stronger than a powered up pacman"
(Lilly Allen / Kaiser Chiefs)
|
|
|
|
|
Thanks they were, not sure how they got goofed up, or why I would need to open it in a text editor to fix it.... maybee there is an easier way...
Regards,
Mike
|
|
|
|
|
1) Is there a way to debug VBScript in a web page?
2) I have a string that represents a color, let's say "#FFFF00". How do I convert that into the individual component colors, like FF, FF, and 00? Here's what I've tried so far:
'-------------------------------------------------------------------------------
'-------------------------------------------------------------------------------
function GetColorValue(sColor, nShade)
Replace sColor, "#", ""
Dim nVal: nVal = 0
select case nShade
case 0 nVal = CLng("&H" & (Mid(1, 2))) ' red
case 1 nVal = CLng("&H" & (Mid(3, 2))) ' green
case 2 nVal = CLng("&H" & (Mid(5, 2))) ' blue
end select
GetColorValue = nVal
end function
2a) Would I be better off usng javascript for this function?
2b) Can I even return a value from a javascript function to vbscript code?
-- modified at 11:57 Monday 7th May, 2007
Here's what I ended up with:
'-------------------------------------------------------------------------------
' Extracts the color value from the string that represents the backgorund color.
' It's assumed that the color will ALWAYS be in the standard hex notation of
' #RRGGBB. jms - 07May2007
'-------------------------------------------------------------------------------
function GetColorValue(sColor, nShade)
Dim nVal: nVal = 0
select case nShade
case 0 nVal = CLng("&H" & (Mid(sColor, 2, 2))) ' red
case 1 nVal = CLng("&H" & (Mid(sColor, 4, 2))) ' green
case 2 nVal = CLng("&H" & (Mid(sColor, 6, 2))) ' blue
case else nVal = 255
end select
GetColorValue = nVal
end function
'-------------------------------------------------------------------------------
' Determines the best choice of text color based on the background color. The
' two possible resulting values are black text or white text. jms - 07MAY2007
'-------------------------------------------------------------------------------
function BestFontColor(sBkColor)
if sBkColor(1) <> "#" OR Len(sBkColor) < 7 then
BestFontColor = "#000000"
exit function
end if
Dim nRed: nRed = GetColorValue(sBkColor, 0)
Dim nGreen: nGreen = GetColorValue(sBkColor, 1)
Dim nBlue: nBlue = GetColorValue(sBkColor, 2)
Dim nThreshold: nThreshold = 105
Dim bgDelta: bgDelta = int((nRed * 0.299) + (nGreen * 0.587) + (nBlue * 0.114))
if 255 - bgDelta < nThreshold then
BestFontColor = "#000000"
else
BestFontColor = "#FFFFFF"
end if
end function
I suppose I could extend the validity checking on the specified background color, but frankly, I'm kinda pressed for time.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hi Guys,
Do you know if how can I pass the value from one aspx to another aspx.
For instance, I have an Employee.aspx that has an EmployeeID (integer type). Then I have another page - EmployeeInfo.aspx.
Now, what is the best way of passing the EmployeeID from Employee.aspx to EmployeeInfo.aspx.
Can you show me some tips on how to do it?
Thanks in advance Guys
hifiger2004
|
|
|
|
|
There are many ways
1)Cookies
2)Session
3)QueryString
Suppose u want to pass variable 'emp_id', using Session
In Employee.aspx page
Session["id"]=emp_id;
In EmployeeInfo.aspx page
string empid=Session["id"].ToString();
|
|
|
|
|
In addition to those mentioned, you can use HttpContext.
See this article fro detailed description of all possible storages
Sincerely,
Elina
Life is great!!!
Enjoy every moment of it!
|
|
|
|
|
Hi Elina,
Thank you. I will read that article - HttpContext.
hifiger2004
|
|
|
|
|
Suppose I have two aspx pages Page1 and Page2. When I redirect from Page1 to Page2, Page2 should load. But if I directly specify the url of Page2, it should not load. How can I do that without using any Session or Cookies.
Thanks
|
|
|
|
|
Check the request source like in asp.net (request.referralurl) and extract the page name from this URL and match with your page1
|
|
|
|
|
Thank u Dev
U gave me the exact answer I was searching for
Request.UriReferrer in ASP.Net
|
|
|
|
|
The truth is there is no real definite way to do this except maybe with session variables and a bunch of stuff that still won't be 100%. Using the referrer is the least reliable method however.
Brad
Australian
- Captain See Sharp on "Religion"
any half intelligent person can come to the conclusion that pink unicorns do not exist.
|
|
|
|
|
hi,i have creat my website 8*6,but am not able to view it properly on other screen resolution,
is there ant code of somthing to make my website fit in the middle of any screen resolution
|
|
|
|
|
You mean it streaches out over the webpage? can you give an example or url?
Stef
|
|
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd"><br />
<html><br />
<head><br />
<title>Untitled Document</title><br />
</head><br />
<br />
<frameset rows="15%,85%" cols="*" framespacing="0" frameborder="no" border="1"><br />
<frame src="top.asp" name="leftFrame" scrolling="NO" noresize><br />
<frameset rows="*" cols="94,*" framespacing="0" frameborder="no" border="1"><br />
<frameset rows="*,85" cols="*" framespacing="0" frameborder="NO" border="1"><br />
<frame src="select.asp" name="leftFrame" scrolling="NO" noresize><br />
<frame src="log.asp" name="bottomFrame1" scrolling="NO" noresize><br />
</frameset><br />
<frame src="down.asp" name="bottomFrame" scrolling="NO" noresize><br />
</frameset><br />
</frameset><br />
<noframes><body><br />
<br />
</body></noframes><br />
</html>
there is a table in the top asp ,this is a frame,but when i view this whole index page with all this frame on my localhost and when i place my mouse on the table and drag it down ,the page move up,i mean keep moving,or when drag the mouse up the page scroll up,not whole page,the table width is 100%.
here is the top.asp code:
<%@LANGUAGE="JAVASCRIPT" CODEPAGE="1252"%><br />
<center></center><br />
<html><br />
<head><br />
<title>Untitled Document</title><br />
<script language="JavaScript" type="text/JavaScript"><br />
<!--<br />
function MM_swapImgRestore() {
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;<br />
}<br />
<br />
function MM_preloadImages() {
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();<br />
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)<br />
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}<br />
}<br />
<br />
function MM_findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {<br />
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}<br />
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];<br />
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);<br />
if(!x && d.getElementById) x=d.getElementById(n); return x;<br />
}<br />
<br />
function MM_swapImage() {
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)<br />
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}<br />
}<br />
</script><br />
</head><br />
<br />
<body bgcolor="#CCC895" ><br />
<div align="left"><br />
<table width="739" height="100" border="0" cellpadding="0" cellspacing="0" ><br />
<tr bgcolor="#990000"> <br />
<td height="19" colspan="4"><font color="#FFFFFF" size="2">my company name<br />
</font></td><br />
</tr><br />
<tr> <br />
<td width="330" height="19" bgcolor="#E19B6C"> </td><br />
<td width="204" height="44" rowspan="3"><img src="5_Kuala_Lumpur_ico_b.jpg" width="199" height="71"></td><br />
<td width="140" height="44" rowspan="3"><img src="5_Kuala_Lumpur_ico_b.jpg" width="141" height="71"></td><br />
<td width="75" height="19" bgcolor="#E19B6C"> </td><br />
</tr><br />
<tr> <br />
<td height="19" bgcolor="#990000"><font color="#FFFFFF"><font size="2">Customer <br />
Come First...</font></font></td><br />
<td height="19" bgcolor="#990000"> </td><br />
</tr><br />
<tr> <br />
<td height="19" bgcolor="#E19B6C"> </td><br />
<td height="19" bgcolor="#E19B6C"> </td><br />
</tr><br />
</table><br />
<font size="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image8','','copyright_bg2.JPG',1)"><img src="copyright_bg.jpg" name="Image8" width="13" height="9" border="0"></a><font color="#000000" size="2">A</font><font color="#000000" size="2">bout <br />
us</font> <a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image9','','copyright_bg2.JPG',1)"><img src="copyright_bg.jpg" name="Image9" width="14" height="12" border="0"></a><font size="2">W</font><font size="2">h</font> <br />
y </font><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image10','','copyright_bg2.JPG',1)"><img src="copyright_bg.jpg" name="Image10" width="12" height="10" border="0"></a> <br />
<font color="#000000" size="2">L</font><font color="#000000" size="2">atest <br />
News</font><font size="2"><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image7','','copyright_bg2.JPG',1)"><img src="copyright_bg.jpg" name="Image7" width="13" height="13" border="0"></a><a href="contact.asp" target="bottomFrame"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image12','','copyright_bg2.JPG',1)"><img src="copyright_bg.jpg" name="Image12" width="13" height="14" border="0"></a><a href="all.asp" target="_parent"><font color="#000000">HOME</font></a></font></div><br />
</body><br />
</html><br />
</center> hope you understood the question,
thanks
|
|
|
|
|
Guyz,
how can Clear Browser's Cache after hitting Logout Button?
If I press back button after logout, it's going to previous page.
How can block this ?
Expecting ur replys...
Thank you
Mohamed Nazeem
|
|
|
|
|
Put following code in to your page load..
Response.Buffer = True
Response.ExpiresAbsolute = DateTime.Now.AddDays(-1D)
Response.Expires = -1500
Response.CacheControl = "no-cache"
Sherin Iranimose
|
|
|
|
|
I work in a web development team of 2 people.
I always just use document.getElementById('blah')
My co-worker always uses a "getLayerObj" function and includes a reference to a 24KB javascript file (dynlib.js) just to use this.
<br />
<br />
function getLayerObj(LAYERID) {<br />
if (ie4) return document.all[LAYERID];<br />
else if (ns4) {<br />
var tempLayerObj = null;<br />
var tempParentObj = (arguments.length == 1) ? document : arguments[1];<br />
for (var tempLayerLoop in tempParentObj.layers) {<br />
var tempObj = tempParentObj.layers[tempLayerLoop];<br />
var tempConstructor = tempObj.constructor + '';<br />
if (tempConstructor.indexOf('function Layer()') != -1) {<br />
if (tempLayerLoop == LAYERID) return tempObj;<br />
else if (tempObj.document.layers.length > 0) tempLayerObj = getLayerObj(LAYERID,tempObj);<br />
}<br />
}<br />
return tempLayerObj;<br />
}<br />
else if (dyn) return document.getElementById(LAYERID);<br />
}<br />
My opinion is this is unnecessary.
I'm trying to get a feeling for whether mine is a minority or majority view so I'd be grateful hearing what everyone elses practice is?
Cheers.
|
|
|
|
|
I'm with you: getElementById is recognised by all modern browsers on both PC and Mac, and IMHO if anyone wants to use something else that's their lookout; It's hard enough (well, ok, time-consuming enough) to code HTML, CSS and Javascript to cope with the major browsers and platforms without having to pander to *every* alternative out there. Somewhere down the line, users have to take responsiblity by using compliant browsers.
Compliant browsers? Someone's going to say "That rules out IE then!" No it doesn't... I'd like someone to tell me by what right w3c and their affiliates determine standards? I don't remember voting for them any more than Microsoft... in fact, I *did* vote for Microsoft:- with my wallet by buying their products.
Fred
|
|
|
|
|
Fred_Smith wrote: I'd like someone to tell me by what right w3c and their affiliates determine standards? I don't remember voting for them any more than Microsoft...
If you check the W3C member list[^], you will see the Microsoft Corporation is one of them.
---
single minded; short sighted; long gone;
|
|
|
|
|
Well of course they would be. That's politics for you. Point is though, Microsoft are the big boys, the winners if you will, and the winners always write the history...and set the standards. What's the point in winning otherwise? Why strive to run faster than everyone else if someone else is going to come along and say you're not allowed to run faster than your competitors?
Fred
The line it is drawn
The curse it is cast
The slow one now
Will later be fast
As the present now
Will later be past
The order is
Rapidly fadin'.
And the first one now
Will later be last
For the times they are a-changin'.
|
|
|
|
|
Fred_Smith wrote: Well of course they would be. That's politics for you. Point is though, Microsoft are the big boys, the winners if you will, and the winners always write the history...and set the standards.
But as they are members, that makes your point pointless. Microsoft is part of the group that has set the standards, and that group is W3C. By being a member, Microsoft has acknowledged W3C as being the group that sets the standards.
---
single minded; short sighted; long gone;
|
|
|
|
|
Very, very, very few people still use Netscape 4, even fewer IE4. If you're aiming at the general population, your time would be better spent making sure Opera and Safari or even the last Mac IE render properly. Unless you are stuck supporting in-house users that are all deeply in love with it, i'd drop IE4/NS4 support faster than a hot chunk of iron.
Heck, even if you do have NS4 users in-house, your time would probably be better spent upgrading them to FF or IE7. This is hardly the only work-around you'd need to properly support such older browsers.
----
It appears that everybody is under the impression that I approve of the documentation. You probably also blame Ken Burns for supporting slavery.
--Raymond Chen on MSDN
|
|
|
|
|
Thanks for the responses so far.
We're not trying to support IE4 and NS4 explicitly, we don't test our sites in them and I know for a start the code I've written won't work in them as well as very likely things like our tree view and menu controls and pages that use AJAX!
Related to Shog's point actually and going off on a bit of a tangent does anyone know where I can get reliable browser usage stats for the web as a whole?
I know the w3c stats page but it's not a representative sample.
Do any of the mega sites (e.g. Google, Yahoo, Microsoft) make their stats available anywhere?
|
|
|
|
|