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

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

Loading into xml not working in Safari

Posted By:      Posted Date: September 03, 2010    Points: 0   Category :ASP.Net
I have a xml http object which is getting me data on a dropdown refresh. This is working perfectly fine in IE but as issues in Safari and mozilla. Please go through my code which returns the contents and iam trying to load values into dropdown and let me know where i am missing it. function AddContents(httpRequest) { if(httpRequest.readyState == 4)   if (window.XMLHttpRequest) { var parser = new DOMParser(); doc = parser.parseFromString(httpRequest.responseText, "text/xml"); } else if (window.ActiveXObject) { doc = new ActiveXObject("Microsoft.XMLDOM"); doc.async = "false"; doc.loadXML(httpRequest.responseText); } alert(doc); var XMLRS = doc.documentElement.getElementsByTagName("Class"); for (i = 0; i < XMLRS.length; i++) { AddItem(document.getElementById("ddl"), XMLRS.item(i).getElementsByTagName("Value").item(0).text , XMLRS.item(i).getElementsByTagName("Id").item(0).text); } }

View Complete Post

More Related Resource Links

Background image of Anchor not working with Safari/Firefox

Hi, I have following Css where i have used back-ground image. Then i am generating Anchor and assigning css class which has image. It works fine with IE but does not work with Safari,Firefox and Chrome. Can anyone help me on how to fix it. I have given details below. Thanks, Chandan Css .HOME { BACKGROUND-IMAGE: url(../images/home.jpg); WIDTH: 56px; BACKGROUND-REPEAT: no-repeat; HEIGHT: 20px } .HOME A { WIDTH: 56px; HEIGHT: 20px } .HOME A:hover { BACKGROUND-IMAGE: url(../images/home1.jpg); WIDTH: 56px; HEIGHT: 20px } Html Code<td class="home"> <A href="#" class="home" onclick="showpage('abc.html')"/></td>

javascript not working in Firefox/Safari


I hope this is the correct place for this post as it's relevant to both ASP.NET and Javascript.

I am creating a nested ListView. In the ListView1 the first column contains an asp:Literal control named LiteralTreeIcon.

In the event OnItemDataBound of ListView1 I am doing the following:

Literal treeIcon = e.Item.FindControl("literalTreeIcon") as Literal;

if (treeIcon != null)
treeIcon.Text = invoices.Count() == 0
? "<img src=\"../Images/treedot.gif\" alt=\"\" height=\"16\" width=\"16\" />"
: String.Format(
"<img src=\"../Images/buttonplus.png\" alt=\"\" height=\"16\" width=\"16\" onclick=\"javascript:toggleGroup(this,'invoices{0}');\" />", header.ID);

This is working correctly, as in the icons are changing depending if there is data in the second ListView or not.

I then have a Javascript function in my ASP.NET page:

function toggleGroup(img, childName) {
var src = img.src;
var parentObject = document.getElementById(childName);

if (parentObject == null) {

Window.open is not working in safari browser



          I m working popup window , its working well in IE and Firefox. But it is not working well in safari browser. Please see my code snippet below,

<script language="javascript" type="text/javascript">
    function CallPrint1(url) {
        var popup = window.open('', 'popup', 'toolbar=no,menubar=no,height=490px,scrollbars=yes,resizable=yes');
        return false;

 And in safari browser settings "Block pop-up windows" -

 if disable "Block pop-up windows" in safari browser,  popup is working well ,

 if i enable "Block pop-up windows" in safari browser, popup is not working well in safari browser

i wants to display popup in enable &a

Response.AddHeader not working in safari


Hi on my website www.findmyhomefromhome.com after a sucessful entry i redirect the users to their previous uploads  which is the manageaccomm page. The code behind that does this is Response.AddHeader("REFRESH", "3;URL=manageaccomm.aspx");

This works in firefox but not in safari. In safari it goes to the following url http://www.findmyhomefromhome.com/manageaccomm.aspx,%203;URL=manageaccomm.aspx

and the message "resource could not be found Requested URL: /manageaccomm.aspx, 3;URL=manageaccomm.aspx". 

I'd like to fix this but keep it working on other browsers . 

Thanks for any help and i hope I provided enough information. 


RegisterStartupScript not working in Safari??


Got a very unusual error where the following code:

StringBuilder sb = new StringBuilder();
        sb.Append("$(function() { ");
        sb.Append(" $('#savebox').show();");
        sb.Append(" $('#savebox').fadeOut('Fast');");
        sb.Append(" $('#savebox').fadeIn('Fast');");
        sb.Append(" $('#savebox').fadeOut('Fast');");
        sb.Append(" $('#savebox').fadeIn('Fast');");
        sb.Append("     setTimeout(function () {");
        sb.Append("         $('#savebox').fadeOut('Slow');");
        sb.Append("     }, 6000);");
        Page.ClientScript.RegisterStartupScript(typeof(Page), "myscript", sb.ToString(), true);
Works in all browsers except for Safari.

Working with SharePoint document libraries

Document libraries are collections of files that you can share with team members on a Web based on Microsoft Windows SharePoint Services. For example, you can create a library of common documents for a project, and team members can use their Web browsers to find the files, read them, and make comments. Users with Microsoft Office 2003 can check out and edit the files as if they resided on a local or network drive.

By default, your team Web site comes with a built-in document library named Shared Documents, which is listed on the Quick Launch bar as well as on the Documents and Lists page.

Working with DropDownList and ListBox Controls in ASP.NET

"In my application i am using dropdownlist to display all categories from a table. When the user clicks this control I display all records in that category. Category table also contains column called color.

I wanted display some categories in dropdown list different color and others in different color using ASP.NET."-Anonymous

Server side validation of Fileupload control not working



I've tried this method in my code behind to try and validate that the Fileupload control has a file or not. I get the error message the the event "Server Validate" cannot be found. Can anyone tell why? Thanks.

Public Sub CustomValidator1_ServerValidate(ByVal source As Object, ByVal args As System.Web.UI.WebControls.ServerValidateEventArgs) Handles CustomValidator1.ServerValidate

' Get file name

        Dim uploadAvatar As FileUpload = DirectCast(AdvertisementForm.FindControl("uploadAvatar"), FileUpload)

        Dim UploadFileName As String = uploadAvatar.PostedFile.FileName

        If UploadFileName = "" Then
            ' There is no file selected
            args.IsValid = False
            Dim Extension As String = UploadFileName.Substring(UploadFileName.L

Row command working on all rows not selected one?



I have this code that hides a column in a gridview.  (The column houses another nested gridview).

    Protected Sub GridView1_RowCommand(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewCommandEventArgs) Handles GridView1.RowCommand
        If e.CommandName = "Select" Then
            If GridView1.Columns(0).Visible = False Then
                GridView1.Columns(0).Visible = True
                GridView1.Columns(0).Visible = False
            End If
        End If
    End Sub

The trouble is that if I click the select link on one row that action to hide is carried out on all rows.  How can I set this up so that it only hides the row that is selected?


upload file not working



iam using masterpage and ajax update panel, i have child page called  fileupload.aspx,i try to upload the file

but its not working , can i use updatepanel in child page , pls very urgent

looking forward for answer.

JQuery Treeview plugin is not working with Ajax page load in ie8


Hi there,

I developed a page where i m using jquery treeview plugin to generate tree. It worked fine on FF, IE8 with out ajax.

But when my page loads thro' ajax call in IE8, it is not collapsing or expanding tree.

Any idea?

Thanks in advance.

JQGrid Loading deleted values



This is quite strange. here is the issue:

Some Info:

1. I'm using a multi-select jqgrid.

2. I have my own delete button to delete multiple orders

The problem:

When i press the delete button on the pager of my jqgrid, the records are deleted from the database but JqGrid shows some records (4-5). On refreshing the grid, correct numbers of records are shown.

Here is the code:

function delorder() {
        var amg = $("#horder").getGridParam('selarrrow');
        var cont = amg.length;
        if (amg.length > 0) {

jquery confirm windows isn't working


Hi, i am using jquery to implement a modal confirm windows but it not working

i have a template field button with ajax confirm using jquery but i have a problem. Apper the confirm windows but when i click on "yes" doesn't execute the delete command. without ajax (using template field button and simple confirm windows javascript) works so well.

Can you give me a hand with this?

thx in advance!

<link href="_assets/css/StyleSheet.css" rel="stylesheet" type="text/css" />
<link href="_assets/css/confirm.css" rel="stylesheet" type="text/css" />
<script src="_assets/js/jquery-1.2.6.min.js" type="text/javascript"></script>
<script src="_assets/js/jquery.simplemodal-1.1.1.js" type="text/javascript"></script>

<script type="text/javascript">
$(document).ready(function() {
       $(".deleteCustomer").click(function(ev) {
                var msg = $(this).attr("title");
                confirm(msg + "?");

Keyboard shortcuts stops working in WebMatrix


I'm often experiencing that keyboard shortcuts stops working in WebMatrix. This is very annoying as CTRL-S, CTRL-C, CTRL-V, etc. stops working, all of which are heavily used when programming. It's obviously hard to explain how to reproduce this, but I was wondering if someone knows a quick-fix?

update/delete not working on server only


my aspx page works in VWD, and everything works on the server EXCEPT update and delete sql functions. any ideas?


New off line application working with sdf file. Need advice


Hey Folks

I am working on a project currently where I need to get data out of a 3rd party vendor's software that uses a .sdf file I looked this up and its a SQL CE file. I was hoping to just link to with with access but thats apparently not going to happen. I need to link to the database extract data from it to a csv file for later use. I also and most important I need to get the data from it and create a report that can be printed while on a customers site that my or may not have web access so I need for this program to be on and off line. I had my webapplication that I have been working on open and was able to bring up the sdf file under the server exploere however I can't seem to get anything out of it when I try to do grid views or detail views errors out.

Can I use one of Visual Studio projects to create this sort of applicaiton if so what would be the best approach. I would love to get an access odbc driver since office is allready installed on the employee's laptop's



Logging to database is not working



Am using Enterprise library 4.0 for logging exceptions to SQL server database. The code is working fine if I run my asp.net application from the Visual studio IDE.However if I publish the site and host it on IIS, then my application is not logging the errors to database.Here is the page load event of my application.Kindly help me in finding out the error.

Thanks in advance


 protected void Page_Load(object sender, EventArgs e)
                //If exception occurs due to unauthorized access
                if ((Request.QueryString["Unauthorized"] != null) && (Request.QueryString["Unauthorized"].Equals("Y")))
                        lblErrorMessage.Text = "You are not authorized to view this page";
                        //Get the user and machine names                       
                        string strUserName = User.Identity.Name;
                        string strMachineName = System.Environment.MachineName;
                        //Raise Error
                        throw new System.UnauthorizedAccessException("Unauthorized access--User Name:" + strUserName + "--Machine Name:" + 
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