473,472 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Browser Detecting

I have following code in asp.net page.

These are two two different ascx pages which I want to run if the browser is
IE or Not. Here I want to handle the flow of control in bettween HTML coding
by put asp.net delimiter

Can someone help me with why it's calling both ascx pages instead which ever
user agent is there
<td valign="top">

<% if (Request.Browser.Browser == "IE"){%>

<uc1:MainLeftIE ID="LeftPanelIE" runat="server" EnableViewState="false"
/>

<%} else{%>

<uc1:MainLeftNon ID="LeftPanelNon" runat="server"
EnableViewState="false" />

<%}%>

</td>

Thanks
Feb 3 '08 #1
2 952
First, an "ASCX" is not a Page, technically it is called a UserControl.
Secondly, I am not sure that the kind of declarative - mixed with
programmatic format you are using here will work. Try doing this is the
codebehind with the LoadControl method instead. In this manner, you do not
have to have any declarative markup at all.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
MetaFinder: http://www.blogmetafinder.com
"Jaams Adams" wrote:
I have following code in asp.net page.

These are two two different ascx pages which I want to run if the browser is
IE or Not. Here I want to handle the flow of control in bettween HTML coding
by put asp.net delimiter

Can someone help me with why it's calling both ascx pages instead which ever
user agent is there
<td valign="top">

<% if (Request.Browser.Browser == "IE"){%>

<uc1:MainLeftIE ID="LeftPanelIE" runat="server" EnableViewState="false"
/>

<%} else{%>

<uc1:MainLeftNon ID="LeftPanelNon" runat="server"
EnableViewState="false" />

<%}%>

</td>

Thanks
Feb 3 '08 #2
Hi Jaams,

You should consider using Control Adapters and Browser Definition files
supported by ASP.NET.

For more information, please refer to the following pages.

http://technet.microsoft.com/en-us/l...oladapter.aspx

http://msdn2.microsoft.com/en-us/library/ms228122.aspx
--
All the best,
Coskun SUNALI
MVP ASP/ASP.NET
http://sunali.com
http://www.propeople.dk
"Jaams Adams" <ja********@yahoo.comwrote in message
news:eD**************@TK2MSFTNGP04.phx.gbl...
>I have following code in asp.net page.

These are two two different ascx pages which I want to run if the browser
is IE or Not. Here I want to handle the flow of control in bettween HTML
coding by put asp.net delimiter

Can someone help me with why it's calling both ascx pages instead which
ever user agent is there
<td valign="top">

<% if (Request.Browser.Browser == "IE"){%>

<uc1:MainLeftIE ID="LeftPanelIE" runat="server" EnableViewState="false"
/>

<%} else{%>

<uc1:MainLeftNon ID="LeftPanelNon" runat="server"
EnableViewState="false" />

<%}%>

</td>

Thanks
Feb 4 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Frances Del Rio | last post by:
pls, why is this not working? <SCRIPT language=JavaScript type="text/javascript"> var br = '<SCRIPT language=Javascript' br += 'src="js_pop.js" type="text/javascript">' br += '</SCRIPT>' var...
16
by: Java script Dude | last post by:
To all Mozilla JS Guru's (IE dudes welcome), I have spent the last three years developing complex DHTML applications that must work in IE 5.5sp2+ but I use Mozilla 1.3+** to do all my...
11
by: James | last post by:
I wasn't sure where to post this so I'm sorry if this is the wrong place. But I would like to know what some of the differences are between client-side and server-side browser sniffing. I'm aware...
17
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this...
25
by: Ryan Stewart | last post by:
I'm working on a project to collect web application usage statistics. What are the recommended ways of detecting whether a browser is JavaScript enabled and/or capable? Obviously I can write a...
2
by: Sam-Kiwi | last post by:
I've spent the last 6 months developing a pay-per-download website using ASP.NET Users purchase documents and then download them. The intention is that users are only charged for documents...
6
by: hemant.singh | last post by:
Hi all, I am trying to get a way by which I'll know exactly when user goes out of my site by clicking on close button in browser, So that w/e user click close button in browser, I can send a...
1
by: Mango | last post by:
I'm trying to print some text in a very specific position on a page, so that it will show through the window of an envelope when folded. This is easy to do, as long as the browser's print margins...
1
by: Grzegorz Klimsa | last post by:
Hi ! I have a problem wiht detecting resolution of client web browser I prepare several files of css style for different browsers and different resolutions, (such as : Style_1024x768.css ;...
10
by: Conrad Lender | last post by:
In a recent thread in this group, I said that in some cases object detection and feature tests weren't sufficient in the development of cross-browser applications, and that there were situations...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.