.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

how to write a code for browser compatible in asp.net 2.0

Posted By:      Posted Date: September 02, 2010    Points: 0   Category :.NET Framework
how to write a code for browser compatible in asp.net 2.0 How to write a code in asp.net for all browser compatible  

View Complete Post

More Related Resource Links

Share Code: Write Code Once For Both Mobile And Desktop Apps


If you're building .NET client apps already, target them to Windows Mobile using the same skills and toolsets.

Daniel Moth

MSDN Magazine July 2007

Wandering Code: Write Mobile Agents In .NET To Roam And Interact On Your Network


In artificial intelligence, an agent is a logical entity that has some level of autonomy within its environment or host. A mobile agent has the added capability that it can move between hosts. In this article Matt Neely brings mobile agents from the halls of academia to a dev shop near you.

Matt Neely

MSDN Magazine February 2006

C++: Write Faster Code with the Modern Language Features of Visual C++ 2005


The next version of Visual C++ has a new syntax that is both elegant and powerful. It has new optimization technology that has improved the speed of Microsoft. It has new compilation modes that ensure Common Language Infrastructure compliance and verifiability for the .NET Framework, and it has new models for interop. In this article Stephen Toub explains these and other improvements to Visual C++.

Stephen Toub

MSDN Magazine May 2004

Browser window is opening up on the second click with javascript code



I am trying to set a javascript code to open up a new browser window with this URL that exists like shown below.

On the first click nothing happens but on the second click the browser window is opening up.


How is it possible to make it open up on the first click ?

                                <asp:ImageButton ID="ImageButton3" runat="server" Height="84px" 
                                    ImageUrl="~/images/1.jpg" Width="165px" 
                                    onclick="ImageButton3_Click" />

    protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        String openURL = "javascript:window.open('" + "Folder1/testing.aspx" + "');return false;";
        ImageButton3.OnClientClick = openURL;


Code write file asp.net 2.0 is working in firefox but IE not working.

If Not IsDBNull(ext) Then                                        ext = LCase(ext)                                    End If                                    Select Case ext                                        'Case ".htm", ".html"                                        '    type = "text/HTML"                   


HI. I NEED LITTLE HELP. I have values 1000,2000,3000, wich located in numValue. Now I have sql table CUSTOM1 with column CUSTOM_ID where located numbers 1000,1001,2005,2006 .. Now if I choose( NumValue == 1000) go to sql table and find Maximum number wich begin with 1000 and add 1 = Result must be 1002 there is my code what change I must do in order to receive the num max + 1?       DataTable dt = new DataTable();         SqlConnection con = new SqlConnection("Data Source=DYS-PC;Initial Catalog=Veolia;Integrated Security=True");         SqlCommand cmd = new SqlCommand("Select Count(*) " + "FROM [MHGROUP].CUSTOM1 " + "WHERE CUSTOM_ALIAS = '" + comboBox2.Text + "'", con);         SqlDataAdapter sqlDa2 = new SqlDataAdapter();         sqlDa2.SelectCommand = cmd;         sqlDa2.Fill(dt);      

How to handle differences in HTML code from different browser versions?

First of all I'm still very new to C# so be gentle :p I'm currently trying to make an application that can login to a certain website and search for some numbers and so on that I can put in an overview, just to save some time. The only thing I found that could do this is the WebBrowser control, and I've managed to make it work, but when I gave the program to a friend it failed. I think it has to do with the difference in browser versions (he uses Internet Explorer 7, I use the latest) and if that's the case I'm pretty clueless how to deal with the problem, since I don't even know what the differences in HTML codes are in each version, and it seems like a lot of work to adjust all the html code to check for accordingly. For example it was even so that & changed to &amp; in my application on my PC and that's only by using one browser so I dunno what happens with other browser versions. I assume that the WebBrowser control always uses Internet Explorer, even if for example Firefox is the standard browser, is this true? But to be sure I asked the friend to put his Internet Explorer as the default browser and still no go. So my question is: is there a relatively easy way to make sure that the program works on practically any PC, without me having to make exceptions for like version 1.6.7 or 1.6.8 (I have no idea what versions there are really)?

Where to write the code for mail in master page

below is my code. please anyone tell me where to write vbscript to send email after validating the fields<%@ Page Language="VB" MasterPageFile="~/Master.master" AutoEventWireup="false" CodeFile="Enquiry.aspx.vb" Inherits="Enquiry" title="Enquiry - MTM Active" %><asp:Content ID="Content1" ContentPlaceHolderID="ConPage" Runat="Server"><script type="text/javascript" src="Js/Blank.js"></script><script type ="text/javascript">function CmdSubmit_onclick(){if (fnValidate()==true)return true;else return false;}function fnValidate() {if(IsBlank(" Name",document.getElementById ("TxtName").value)==false)        {            document.getElementById ("TxtName").focus();            return false;         }        if(IsBlank(" Email",document.getElementById ("TxtEmailID").value)==false)        {            document.getElementById ("TxtEmailID").focus();            return false;    &n

Open browser window + populate from code behind

Hi,I have a variable, which contains a whole web page. Is there a way to open a new browser window and set the contents of this variable as the page? I don't mind if it's javascript, but it has to be able to hold a bit of data if this is the case.Thanks!

HOW can i write code for scrolling images in asp.net

plz help me in this topic in one perticular area the image should scroll for every 45 sec's

write server side code in External JS files

Salam To All,for my JS code, some times i need to organize my code, so i prefer to put some of javascript functions in external js files and  include it in my page as well.but i am face a problem if i need to write some .Net code especially to Get the Client ID for any of .net controls.so do you have a way to write the following code in External JS file?('#<%= this.ddlMake.ClientID %>').change(function(

Sharepoint 2010: Browser compatible infopath forms are not open in web browser for editing


I created a browser enabled form with InfoPath 2010. I then published the form by selecting the option "Publish form to a SharePoint library" and then selected "Form library" and finally selected "Create a new form library". As a result, a new form library was created.When I click on "add document", the browser opens a new form, which I can fill and save successfully. However, after the form is saved, whenever I click on the form name in the form library to edit it, the browser "opens with" dialog box opens, asking for an XML editor software. In other words, the form does not open in browser for editing even on systems that do not have InfoPath installed.

The form is browser compatible and the form library is configured to open browser-enabled forms in browser. The issue is that the form hyperlink is directly pointing to form XML file rather than pointing to InfoPath form services URL.

I would really appreciate, if someone tells me how I can edit the form in browser.




how write code in my javascript function and modify it?


hi there
i have a function in my javascript code:

   <script language="Javascript">
  function showAddress(address)

          if (geocoder) 

actually, i set GeoMap variable from asp.net
the problem is that when GeoMap change value, the script does not change!
so, the button who change this value is in a UpdatePanel, does this got problem?

how can i do this?

How to close individually the multiple open browser window using c# code?


Hello guys,

The scenario is I have multiple open browser window (IE or Firefox) then I want to close the specific browser individually.

I have tried to lookup the applications running from the task manager but I can't get the running application from the task manager > application > task.

I have added two references below to lookup the task running applications.

using System.Diagnostics;
using System.Threading;

Anyone can help me on how to close individually the specific open browser window using c# code event.


How to write good code?


These are several general questions about writing code behind.

I already read some best practices for asp.net

The questions are:

1. Do I need to use interfaces and/or delegates for simple applications? I just cannot get in simple terms WHEN to use them. (I assume that delegates are not necessary is Asp.net, because they are by default)

2. Do we need to turn off viewstate whenever possible? Is it crucial for perfomance?

3. If I retrieve value from database on page load, how do I pass this value to other functions? For example:

protected void Page_Load(object sender, EventArgs e)
        int GameID = db.Games.Where(p => p.IsActive == true).Select(p => p.GameID).SingleOrDefault();

Do I just copy this statement to different function? for example: 

protected void Button1_Click(object sender, EventArgs e)
        int GameID = db.Games.Where(p => p.IsActive == true).Select(p => p.GameID).SingleOrDefault();

Or I use session variables for this? Or I make this Int GameID Global variable?

4. When do i need to create separate files for classes? How many events should I have? Is it crucial to use classes in separate files?

5. Is enabling/disabling/hiding controls from code b

how to write solid code for this case


here is a common scenario:

insert into table A

select xx, xx, xx

from table B -- where B has the rows we want to insert, but need to join to table C to get some more info

inner join table C

on ......

the problem is, if there is any missing data in table C, we might lose data.  because of the missing data. but using left join will also cause issues for possible NULLs etc.

is there a good coding practice that will do the insertion and check for possible issues, for example, break and raise error if i find missing data becuase of the joins?



IIS web site server code: detecting if client browser supports TLS https encrption mode



Due to security restrictions, we must run our web site under the TLS variant of https (SSL is disabled on the server...only TLS is enabled on the server).

The problem we have is that some customers have TLS disabled in their Internet Explorer  Tools/Internet Options/Advanced settings...and they get a "page cannot be displayed" error.

I need a way to tell those users to "go enable TLS on your browser" (like display a page for this saying this).

Can you tell me how I can determine if (with the server having only TLS...not SSL...enabled) if the browser can support the https?

Some more details on the issue:

I've watched the conversation between the browser client and the server, and it appears that the conversation flow is as follows:

1.) Browser broadcasts to the server which https protocols it supports (and has enabled) (i.e. SSL 1.0, SSL 2.0, TLS 1.0, etc.)

2.) Server checks its configuration (which https protocols are setup to be allowed on the server) and returns back on one of the browser client matching protocols.


What I need to determine is how to detect if TLS is enabled on the browser that makes a request (determine it in the ASP.NET server code), so I can generate a page (in the case TLS is not supported on the IE browser) to inform the user.

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend