Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 775643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T19:19:26+00:00 2026-05-14T19:19:26+00:00

In my Default.aspx web page i use the following code in order to save

  • 0

In my Default.aspx web page i use the following code in order to save some Attributes to an xml file

<asp:Button ID="Button1" Text="Save Attributes" CssClass="Button01" runat="server"  OnClientClick="SaveAttributesButton_Click(); return, false;" >
                        </asp:Button>

when i Click on the button is making post back

I have already use the HTML Button with the same problem
I’ve change a bit my code like:

    <asp:Button ID="Button1" Text="Save Attributes" CssClass="Button01" OnClick="SaveAttributesButton_onclick" OnClientClick="return, false" >
                            </asp:Button>

And i put the SUB in a script into my page, trying to avoid post back, but nothing

Please is there anybody which can assist me on this issue?

Well Dear Chris Thank you very much for your attention to my issue
I did the following to my page

<asp:Button ID="SaveAttributesButton" runat="server" Text="Save Attributes" CssClass="Button01"  OnClientClick="return SaveAttributesButton_Click;" >
                            </asp:Button>
                           <script type="text/VB" language="VB" runat="server" >

                               Public Sub SaveAttributesButton_Click()

                                   Dim fullpath As String = Request.MapPath(HostingEnvironment.ApplicationVirtualPath)
                                   Dim myXmlWriter As XmlTextWriter = Nothing

                                   Try
                                       myXmlWriter = New XmlTextWriter(fullpath & Strings.Right(XMLFile, Len(XMLFile) - 1), System.Text.Encoding.UTF8)
                                       With myXmlWriter
                                           .Formatting = System.Xml.Formatting.Indented

                                           myXmlWriter.Close()
                                       End With
                                       myXmlWriter.Close()
End Sub
</script>

But the results where the same my button makes Post Back
In my aspx file i have two thinks made
One is that

<input type="button" ID="SaveAttributesButton" runat="server" class="Button01"  value="Save Attributes" onclick="return SaveAttributesButton_onclick();" />

And the other is that

    <script language="javascript" type="text/javascript">
// <![CDATA[

        function SaveAttributesButton_onclick() 

        {
           <%SaveAttributes() %>
        }

// ]]>
    </script>

So, as you may see the first is the button and the second is the Java code
But since i don’t know how to programm in Java then i decide to right the name of the Sub which runs in the “behind code file”
In this case when i’m runing the programm my sub runs automatically, but when i’m pushing the button nothing happen
I know that the command pass throu the Java script but she don’t execute the line <%SaveAttributes()%>
Can you help me on this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T19:19:27+00:00Added an answer on May 14, 2026 at 7:19 pm

    The comma in “return, false” causes a javascript error. Instead it should just be “return false;”

    Or you can use “return myFunction();” then have the return value of your function determine whether a post back should occur or not.

    UPDATE:

    What you have with the <%SaveAttributes()%> won’t work. You need to make a choice. Either

    1. Go with a regular full post back. I recommend this above the others because of the problems you are hitting with javascript; or,
    2. Learn about AJAX and partial post back events. There are some good articles on this here.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Default.aspx page, which inherits from BasePage.cs, which inherits from System.Web.UI.Page. BasePage is
I have the following webform: <%@ Page Language=C# AutoEventWireup=true CodeBehind=Default.aspx.cs Inherits=TestWebApp.Default %> <!DOCTYPE html
In my default.aspx page, I have some ESRI tools (and some commands) in a
I have a web form page Default.aspx, which inherits from a BasePage class that
In the filesystem I have /file.aspx /directory/default.aspx I want to configure IIS so that
I am trying to aid another programmer with a page called Default.aspx with a
Any ideas why the built in asp.net webserver insists on serving /default.aspx whenever you
I learned Why Request.Browser.Crawler is Always False in C# ( http://www.digcode.com/default.aspx?page=ed51cde3-d979-4daf-afae-fa6192562ea9&article=bc3a7a4f-f53e-4f88-8e9c-c9337f6c05a0 ). Does anyone
I have configured my default page to be say abcd.aspx and is under ~/View//abcd.aspx
In one of my projects I need to build an ASP.NET page and some

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.