Forums

ASP

This topic is locked

how to do

Posted 27 Jul 2006 11:19:30
1
has voted
27 Jul 2006 11:19:30 meenu susi posted:
i have two links as
imagelink
textlink
when a user click imagelink then textlink has to get disabled
and if user click textlink the imagelink has to get disabled...
how to do this..
can anyone help me out..

with regards
meenu

Replies

Replied 10 Aug 2006 19:10:18
10 Aug 2006 19:10:18 Charles Harford replied:
can't you make both the text and image use the same link?

e.g.
<a href="link.htm"><img src="image">Text link here</a>



Charlie
Replied 12 Aug 2006 10:55:42
12 Aug 2006 10:55:42 meenu susi replied:
<BLOCKQUOTE id=quote><font size=1 face="Verdana, Arial, Helvetica" id=quote>quote:<hr height=1 noshade id=quote>
can't you make both the text and image use the same link?

e.g.
&lt;a href="link.htm"&gt;&lt;img src="image"&gt;Text link here&lt;/a&gt;



Charlie
<hr height=1 noshade id=quote></BLOCKQUOTE id=quote></font id=quote><font face="Verdana, Arial, Helvetica" size=2 id=quote>
Replied 12 Aug 2006 11:00:51
12 Aug 2006 11:00:51 meenu susi replied:
hi..

u dint get my question...
i am having two links in a page..

for ex,.
one link named as add text
another link as add image..

when the user click first link...it has to get posted to text.asp///
and when they clcik second link it has to get posted to image.asp..

and when they clcik first link means the second link has to get disabled..similary ..the other..

it means that they are allowed to select only one link...

reagrds
meenu
Replied 12 Aug 2006 11:47:06
12 Aug 2006 11:47:06 Charles Harford replied:
OK, I see.

Try this idea.
On the text.asp page set a session like:
&lt;% Session("Link" = "Text" %&gt;

On the image.asp page set a session like:
&lt;% Session("Link" = "Image" %&gt;

Then make the links on your page conditional:
&lt;%
If NOT Session("Link" = "Text" Then
Response.Write("&lt;a href=""text.asp""&gt;Text link&lt;/a&gt;"
End If

If NOT Session("Link" = "Image" Then
Response.Write("&lt;a href=""image.asp""&gt;Image link&lt;/a&gt;"
End If
%&gt;




Charlie
Replied 12 Aug 2006 12:46:16
12 Aug 2006 12:46:16 meenu susi replied:
hi ....

i dint get the resuly ya,...
but what u told was somewhat nearer tot he result..

i tried ur code it is working fine...
but what the problem is...

according to ur code what was happening is...
in main page a link is displayed as imagelink...when i click that link
it is getting posted to the image.asp and when i return to the main page then now text link is appearing...

what i want is...instead of one link in main page..
i want both the image link and text link to get displayed inthe main page..
when user click text link it will get posted to text.asp
and when they return back both the links are there but the image link will have to get disabled...

it means that user can ether select text are image not both..

but u code was working fine..the concept was good but i want the above things to be done..

help me if possible..
thanks a lot for ur reply..
with regards
meenu
Replied 12 Aug 2006 13:42:43
12 Aug 2006 13:42:43 Charles Harford replied:
Try this:

&lt;%
If Session("Link" = "Text" Then
Response.Write("&lt;a href=""text.asp""&gt;Text link&lt;/a&gt;"
End If

If Session("Link" = "Image" Then
Response.Write("&lt;a href=""image.asp""&gt;&lt;img src=""yourimage.gif"" border=""0""&gt;&lt;/a&gt;"
End If

If Session("Link" = "" Then
Response.Write("&lt;a href=""text.asp""&gt;Text link&lt;/a&gt;&lt;br&gt;"
Response.Write("&lt;a href=""image.asp""&gt;&lt;img src=""yourimage.gif"" border=""0""&gt;&lt;/a&gt;"
End If
%&gt;

<b>NOTE:</b> You sent me a message regarding images sizes.
You will need to use a server behaviour like "Smart Image Processor"
Also please do not send messages directly to me. Always use the Forum so that other people can help and learn from your problems. I will not reply to messages sent directly to me. I'm sure you will understand.
Thanks.

Charlie
Replied 12 Aug 2006 14:32:45
12 Aug 2006 14:32:45 meenu susi replied:
hi

not worked...
result was..
in current page only text link is present.. no image link..

but when i set in current page session=""
the two links r available in current page but
when i click any one of the link and posted to that page and when i return back
to the current page again the two links are in anable condition..
if i click text link and go means..
when i came back the text link also in enable state along with image link..

dont mistake that i am disturbing u for a long time..
then forgive me for the mistake..
Replied 12 Aug 2006 20:25:37
12 Aug 2006 20:25:37 Charles Harford replied:
Remember Sessions will remain active all the while you have your browser window open and continue to click around. To remove the sessions you must quit your browser and open it again. If you want to set the session="" on your page with the links make sure you put it after the links code. However this will mean if a user refreshes their screen both links will become active again.

The session method should work but you may need to play around with it for a while.

I'm away from my desk at the moment but if you can wait until Monday I will take another look for you.



Charlie
Replied 13 Aug 2006 10:51:33
13 Aug 2006 10:51:33 meenu susi replied:
ok thanks for ur help..
i can wait still monday...

with regards
meenu
Replied 13 Aug 2006 18:54:43
13 Aug 2006 18:54:43 Charles Harford replied:
Try this:

&lt;%
Dim varLink
If Session("Link" &lt;&gt; "" Then
varLink = Session("Link"

Select Case varLink
Case "Text"
Response.Write("&lt;a href=""text.asp""&gt;Text link&lt;/a&gt;"
Case "Image"
Response.Write("&lt;a href=""image.asp""&gt;&lt;img src=""yourimage.gif"" border=""0""&gt;&lt;/a&gt;"
End Select

Else
Response.Write("&lt;a href=""text.asp""&gt;Text link&lt;/a&gt;&lt;br&gt;"
Response.Write("&lt;a href=""image.asp""&gt;&lt;img src=""yourimage.gif"" border=""0""&gt;&lt;/a&gt;"
End If

%&gt;

Charlie
Replied 16 Aug 2006 09:48:50
16 Aug 2006 09:48:50 meenu susi replied:
hi..
again its not working..
when i click text and posted to text page..and when i return back to
the page..both text and image are in enable condition..i mean both the links r in enable state..

with regards
meenu
Replied 16 Aug 2006 10:07:00
16 Aug 2006 10:07:00 Charles Harford replied:
Send me your files and I'll take a look.

Charlie
Replied 16 Aug 2006 10:36:06
16 Aug 2006 10:36:06 meenu susi replied:
do u want me to send the asp pages..
to ur mailid..
r else..
Replied 16 Aug 2006 10:52:52
16 Aug 2006 10:52:52 Charles Harford replied:
Yes, send me your ASP pages and i will see if I can code it how you want.

<b>NOTE.</b> This is not something I would normally do. To anyone else out there reading this - DO NOT send me your files as I will ignore them. I'm sure you will all understand - I'm just way too busy to help everyone out with their code. Besides, this forum is for DMXZONE extensions and not ASP in general. There are more dedicated ASP forums around for that.

Charlie
Replied 16 Aug 2006 11:17:28
16 Aug 2006 11:17:28 meenu susi replied:
hi..
i am not able to attach the files..
how to send it..
i am new to forum posting thats why........

Reply to this topic