473,379 Members | 2,675 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

C# Web-App: Persisting Title of Modal Dialogbox during Postback

Hi All,

I am using ASP.NET 2.0 and C#.

I am opening a Modal Dialog Box from .aspx page.

This dialgo box contains a grid and user can add new recod to this grid from here.

When this dialgo is opend fist time everything works well.

If I add new record on this dialog box which postbacks the page which is contained within the dialog I lost the "Title" of the popup dialog.

I tried to set the "title" on .asp page/Page_Load event but unable to presist the Title of Modaldailog box on Postback.

Regards,
Virendra Jhala
Dec 3 '07 #1
4 3314
Frinavale
9,735 Expert Mod 8TB
Hi All,

I am using ASP.NET 2.0 and C#.

I am opening a Modal Dialog Box from .aspx page.

This dialgo box contains a grid and user can add new recod to this grid from here.

When this dialgo is opend fist time everything works well.

If I add new record on this dialog box which postbacks the page which is contained within the dialog I lost the "Title" of the popup dialog.

I tried to set the "title" on .asp page/Page_Load event but unable to presist the Title of Modaldailog box on Postback.

Regards,
Virendra Jhala
Hi Virendra,


You can set the page's title in the <%@ Page ..%> directive...
Eg:

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.master" CodeBehind="Index.aspx.vb" Inherits="MyNamespace.Welcome" title="My Title" %>

Have you tried using globalization to set your title's and prompts?
For instance the following will go to the resource file (.resx file) for this page and automatically set the title...
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.master" CodeBehind="Index.aspx.vb" Inherits="MyNamespace.Welcome" title="My Title" Culture="auto" meta:resourcekey="PageTitle" UICulture="auto"  %>
This will also grab the culture specific title for the page...eg...if someone were coming to your website and their browser's culture was set to "es-mx", your website will automatically look for a Spanish (Mexico) resource and fill the page's title with this text.

If this isn't the type of answer you're looking for let me know....

-Frinny
Dec 3 '07 #2
Hi Frinny,

After posting this issue I did try the first option of setting up the Title in @Page directive but it did not work.

I am using IE 6.0 on Windows XP.

The application does not have anything on Globalization front so I did not attempt your second option.

It seems that there is something inherent in web dialog which is causing this behaviour.

Let me know in case you have anything else.

Here is the sample code I am using for opening the popup on a Html button click.

window.showModalDialog("comment.aspx",'','resizabl e:no;
status:no;dialogWidth:420px;dialogHeight:320px;');


I tried setting up the "Title" in following ways:

1. Passed the argument in the showModalDialog function
2. On the .aspx page <Head><Title></Title></Head>
3. In code behind..Page_Load..this.Title = "Mytitle"
4. In the Page directive

Regards,
Virendra Jhala


Hi Virendra,


You can set the page's title in the <%@ Page ..%> directive...
Eg:

Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.master" CodeBehind="Index.aspx.vb" Inherits="MyNamespace.Welcome" title="My Title" %>

Have you tried using globalization to set your title's and prompts?
For instance the following will go to the resource file (.resx file) for this page and automatically set the title...
Expand|Select|Wrap|Line Numbers
  1. <%@ Page Language="vb" AutoEventWireup="false" MasterPageFile="~/MasterPage.master" CodeBehind="Index.aspx.vb" Inherits="MyNamespace.Welcome" title="My Title" Culture="auto" meta:resourcekey="PageTitle" UICulture="auto"  %>
This will also grab the culture specific title for the page...eg...if someone were coming to your website and their browser's culture was set to "es-mx", your website will automatically look for a Spanish (Mexico) resource and fill the page's title with this text.

If this isn't the type of answer you're looking for let me know....

-Frinny
Dec 3 '07 #3
Frinavale
9,735 Expert Mod 8TB
Hi Frinny,

After posting this issue I did try the first option of setting up the Title in @Page directive but it did not work.

I am using IE 6.0 on Windows XP.

The application does not have anything on Globalization front so I did not attempt your second option.

It seems that there is something inherent in web dialog which is causing this behaviour.

Let me know in case you have anything else.

Here is the sample code I am using for opening the popup on a Html button click.

window.showModalDialog("comment.aspx",'','resizabl e:no;
status:no;dialogWidth:420px;dialogHeight:320px;');


I tried setting up the "Title" in following ways:

1. Passed the argument in the showModalDialog function
2. On the .aspx page <Head><Title></Title></Head>
3. In code behind..Page_Load..this.Title = "Mytitle"
4. In the Page directive

Regards,
Virendra Jhala
Could you please post your <%@ Page %> directive.
When I tried:
Expand|Select|Wrap|Line Numbers
  1.  window.showModalDialog("Index.aspx", "", 
  2.       "resizable:no;status:no;dialogWidth:420px;dialogHeight:320px")
It worked fine....

-Frinny
Dec 3 '07 #4
Could you please post your <%@ Page %> directive.
When I tried:
Expand|Select|Wrap|Line Numbers
  1.  window.showModalDialog("Index.aspx", "", 
  2.       "resizable:no;status:no;dialogWidth:420px;dialogHeight:320px")
It worked fine....

-Frinny
Hi Frinny,

Here is the page directive of my page.

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="OpsComments.aspx.cs"
Inherits="MyCompay.Web.UI.OpsComments" title="My Page" %>

I can see the Title once the modal is opened first time from detail page.

Now I can add new record in this modal by entering some values and hitting Submit button which does a postback on the same popup.

After Postaback I can see the newly added record in the List Grid but the modal dialog is unable to presist the Title.

Regards,
Virendra Jhala
Dec 3 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: PatrickSA | last post by:
Hi, Am new to web services, so apologies for the basic nature of the question - and apologies in advance if this is the wrong newsgroup. We're building a new web service and I'm looking around...
8
by: John Baker | last post by:
Hi: I am URGENTLY in need of some book or web site OR tool that will help me integrate a relatively simple access application into a web page or pages. This is a time recording system (by...
0
by: Erick Lopez | last post by:
When I send my web page to browser in ouput windows recibe this message and the web page the error BC32400 Please Help me Auto-attach to process ' aspnet_wp.exe' on machine 'TABLET'...
5
by: Michael Herman \(Parallelspace\) | last post by:
1. What are some compelling solutions for using Master/Content pages with Web Pages? 2. If a content area has a web part zone with web parts, what is the user experience like when "editting" the...
0
by: pd123 | last post by:
I'm new to C# and .net and I'm trying to create a form that will register users in a sql server database. I have the following code but when I run the code I get an error " The name 'Peter' is...
7
by: Jonas | last post by:
Hi. I'm trying to develop a web custom control that uses a programmatically created treeview. My problem is that I get an exception when I try to render the control. With properties do I have to...
2
by: job | last post by:
In a sharepoint setup using smartpart to load our user controls using enterprise blocks (data) we are getting some strange errors (logged to the event log). We dont get the error all the time. When...
3
by: =?Utf-8?B?RGFuZGFuIFpoYW5n?= | last post by:
Now I have a web application, a web service and a SQL Server database. The Web application will invoke the web service, the web service invokes the SQL Server stored procedure. I let the web...
20
by: =?Utf-8?B?cmtibmFpcg==?= | last post by:
I was executing the steps given in http://suppor.microsoft.com/kb/308359 for testing a sample web service application. However, the following line gives a compilation error: localhost.Service1...
2
by: =?Utf-8?B?YW5vbg==?= | last post by:
I am not sure if this is the right forum. Environment : Windows server 2008, IIS 7.0 I get the 'Could not load the file or assembly 'blowery.web.httpCompress' or one of its dependencies. The...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...

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.