|
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?
|
|
|
|
|
MartinSmith wrote: 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?
Short answer: you can't.
Longer answer: the reliability of any statistics based on user agent strings is somewhat poor; while well-behaved spiders will identify themselves as such, there are plenty of spam bots and site scrapers that will identify themselves as browsers to avoid detection. And even if this wasn't true, unless you're setting up the next Google or Y!, Google and Y! stats aren't even applicable - you might have a very different set of users, and browsers that are a tiny minority among visitors to those sites could be a sizable percentage of visitors to yours - or completely non-existent.
The best suggestion i can give you (if your site is already live) is to analyze your own logs or use a service such as Google Analytics[^] to collect information on who is visiting with what browser. And then, take it with a grain of salt.
----
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
|
|
|
|
|
Good Points.
I'd better dust off my LogParser queries!
|
|
|
|
|
Hello All,
I want to make a website that will contain a number of galleries each gallery will have some photos and each gallery will be in a separate folder with different name, the problem is that I don't know if I can pass the folder name dynamically to the flash to load images within this gallery, or something like that. The main idea is that everything will be dynamically (i.e. I don't know # of galleries or their names, # of photos or their names ...) any ideas? (note: tools that allowed to be used, asp.net, flash, swish, xml, sql)
Thanks
|
|
|
|
|
|
when i run application on simple browser it works.
but when i browse it with mozilla it makes broblem of stylesheet.
|
|
|
|
|
Use the error console, it will exactly print the problems
Stef
|
|
|
|
|
Error: System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.
this is my code:
System.IO.MemoryStream ms = new System.IO.MemoryStream();
string ipath=Server.MapPath("~/image.gif");
image.Save(ipath, System.Drawing.Imaging.ImageFormat.Gif);
Response.ClearContent();
Response.ContentType = "image/Gif";
ImageMap1.ImageUrl = ipath;
anybody help me.
|
|
|
|
|
jayvaishnav82 wrote: this is my code:
System.IO.MemoryStream ms = new System.IO.MemoryStream();
string ipath=Server.MapPath("~/image.gif");
image.Save(ipath, System.Drawing.Imaging.ImageFormat.Gif);
Response.ClearContent();
Response.ContentType = "image/Gif";
ImageMap1.ImageUrl = ipath;
You mean that this is part of your code? It's not enough of your code to diagnose the problem.
How do you create the image object? Why do you create a memory stream that you don't use? Why are you changing the content type of the page when you are still creating an html page?
---
single minded; short sighted; long gone;
|
|
|
|
|
Wow. I'm guessing that you just cobbled together this code without actually trying to figure out what it does?
The error probably indicates that you're trying to save to an invalid path, or to a location where the ASP.NET user doesn't have write access. But that's hardly the only thing keeping this code from working.
- Stop.
- Think about what you're trying to do.
- Identify what needs to happen in order to accomplish that.
- Write the code to do those things.
- If you are tempted at any point to include even a single line whose purpose you do not know or understand, stop and re-think what you're doing.
----
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
|
|
|
|