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

  • Home
  • SEARCH
  • 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 1065875
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T19:55:17+00:00 2026-05-16T19:55:17+00:00

How do I create a Javascript method in here that RELOADS the .aspx page,

  • 0

How do I create a Javascript method in here that RELOADS the .aspx page, that I can call during one of those other existing methods.

    <%@ Page Language="VB" Inherits="Core.Web.BaseView(OfLending.Controllers.Workspace.DocumentUploadData)" %>
    <%@ Import Namespace="Framework.WebControls.Forms" %>
    <%@ Import Namespace="Framework.WebControls.Grids" %>

    <script runat="server">

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title></title>
        <script language="javascript" type="text/javascript">

            function RefreshGrid(result, data) {
                if (data.responseText.length > 0) {
                    var obj = eval('(' + data.responseText + ')');
                    if (obj.Result == false) {
                        Global.alertError(obj.UserMessage, obj.ExceptionID);
                    }
                    else {
                        Global.getComponent('txtDescription').setValue('');
                        mygrid.refresh();
                    }
                }
            }

            var uploadWindow
            var showUploadWindow = function() {
                if (!uploadWindow) {
                    uploadWindow = new Ext.Window({
                        title: 'Attach Document'
                        , width: 450
                        , height: 140
                        , closable: true
                        , closeAction: 'hide'
                        , iconCls: ''
                        , layout: 'form'
                        , bodyStyle: 'padding:10px 10px 0px 2px'
                        , labelWidth: 100
                        , labelAlign: 'right'
                        , renderTo: DocumentUploadForm_FormViewPort.getEl()
                        , constrain: true
                        , modal: true
                        , items: [{
                            xtype: 'textfield'
                            , validationEvent: 'blur'
                            , enableKeyEvents: true
                            , anchor: '100%'
                            , fieldLabel: '* Select File'
                            , labelStyle: 'color:red'
                            , el: 'fuDocument'
                            , id: 'fuDocument'
                            , allowBlank: false
                            , blankText: 'File Upload is a required field'
                            , inputType: 'file'
                        }, {
                            xtype: 'textfield'
                            , anchor: '100%'
                            , fieldLabel: 'Description'
                            , id: 'txtDescription'
                            , allowDecimals: false
                            , decimalPrecision: 0
                            , maxLength: 100
                            , maxLengthText: 'Description must be no more than 100 characters in length'
                        }]
                        , buttonAlign: 'center'
                        , fbar: [{
                            text: 'Save', iconCls: 'icon-button-save', handler: function() { uploadDocument() }
                        }, {
                            text: 'Cancel', iconCls: 'icon-button-cancel', handler: function() { uploadWindow.hide() }
                           }]
                        })
                    }
                    uploadWindow.show();
                    mapEnterKey(uploadWindow);
                }

            function viewContent() {
                var docId = mygrid.getSelectedString('DocumentId');
                window.location = "Edit/" + docId;
            }

            function uploadDocument() {
                uploadWindow.hide();
                DocumentUploadForm.doAction('SAVE')
                mygrid.refresh();
            }

            //this function maps enter key
            function mapEnterKey(obj) {
                var keyMap = new Ext.KeyMap(obj.getEl(), {
                    key: Ext.EventObject.ENTER,
                    stopEvent: true,
                    handler: uploadDocument
                });
            }

        </script>
    </head>
    <body>
        <form id="form1" runat="server">

            <div style="display:none">
                <asp:FileUpload ID="fuDocument" runat="server"  />
            </div>

            <% 
                Using DocumentUploadForm As New WebControls.Forms.Form()
                    With DocumentUploadForm
                        .ID = "DocumentUploadForm"
                        .Framed = False
                        .ItemName = "Document"
                        .Title = "Application Documents"
                        .TitleStyle = Forms.Form.TitleStyleType.TitleBar
                        .IconCls = "icon-blank-16"
                        .OnSubmitCallback = "RefreshGrid"
                        .Toolbar.UseDefaultButtons = False

                        With .CenterRegion
                            Using mygrid As New WebControls.Grids.Grid()
                                With mygrid
                                    .ID = "mygrid"

                                    .GridItemName = "document"
                                    .Title = "Uploaded Documents"
                                    .Mode = Grid.GridMode.Tab
                                    .OnDoubleClick = "viewContent"
                                    .SetEditPage("Workspace/DocumentUpload.mvc", "DocumentId")

                                    With .Toolbar
                                        .AllowSearch = False
                                        .UseDefaultButtons = False
                                        With .AddButton("Attach Document", "function(){showUploadWindow();}")
                                            .RequiresRowSelection = False
                                            .IconClass = "icon-button-create"
                                        End With
                                        With .AddButton(Grids.Grid.GridToolbar.ButtonType.Edit)
                                            .Text = "View Document"
                                            .Handler = "viewContent"
                                            .IconClass = "icon-button-preview"
                                        End With
                                        With .AddButton(Grids.Grid.GridToolbar.ButtonType.Delete)
                                            .Text = "Delete Document"
                                        End With
                                        .PushItems()
                                        With .AddButton("Close Window", "function(){window.close()}")
                                            .RequiresRowSelection = False
                                            .IconClass = "icon-button-cancel"
                                        End With
                                    End With

                                    .Columns.AddHidden("DocumentId")
                                    .Columns.Add("Name", "Name", Grid.ColumnDataType.String, 200)
                                    .Columns.Add("Description", "Description", Grid.ColumnDataType.String, 450)

                                    .DataSource = ViewData("Documents")
                                    .DataBind()
                                    Response.Write(.ToString())
                                End With
                            End Using
                            .AddControl("mygrid", "Documents", Forms.Control.ControlType.Grid)
                        End With


                    End With

                    Response.Write(DocumentUploadForm.ToString())
                End Using
            %>

        </form>
    </body>
    </html>
  • 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-16T19:55:17+00:00Added an answer on May 16, 2026 at 7:55 pm

    Figured it out. Change RefreshGrid() to this.

    function RefreshGrid(result, data) {
                    window.location.reload();
                    if (data.responseText.length > 0) {
                        var obj = eval('(' + data.responseText + ')');
                        if (obj.Result == false) {
                            Global.alertError(obj.UserMessage, obj.ExceptionID);
                        }
                        else {
                            Global.getComponent('txtDescription').setValue('');
                        }
                    }
                }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to create a small Javascript framework that I can use in my
I would like to create a String.replaceAll() method in JavaScript and think using a
V8's documentation explains how to create a Javascript object that wraps a C++ object
How can I use the Prototype library and create unobtrusive javascript to inject the
What is the correct syntax to create objects in javascript that will work across
I need to create simple reusable javascript object publishing several methods and parameterized constructor.
I would like to create a javascript modal pop up window to get some
Is there any way in JavaScript to create a "weak reference" to another object?
I want to create a compiled JavaScript file for my website. For development I
I use the following code to create countdowns in Javascript. n is the number

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.