.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 new form from another form

Posted By:      Posted Date: April 14, 2011    Points: 0   Category :Windows Application

I am developing an application using C#. Now I am in a serious trouble. I nned urgent help.

The application have a splash screen. It will done basic checks to run the application. I am using background worker for displaying details of background jobs in splash screen.

private void backgroundWorker1_RunWorkerCompleted(object sender, RunWorkerCompletedEventArgs e)
      Form1 home = new Form1();

The problem is, Form1 closes soon after it display. I search a lot. But I didn't get correct info. Please help.

View Complete Post

More Related Resource Links

InfoPath Workflow Task Form "Loading" event handler only being called after App Pool recycled.


I have a Workflow that is using an InfoPath task form.  In the "FormEvents_Loading" method event handler I have some code that needs to run each time the form is opened.   I recycle the App Pool and open the form the code runs perfectly, but if I close and try to re-open the form the code is not run at all.  I can then recycle the App Pool again and on the next load the code executes just fine.   The code that is supposed to be run is a very simple statement to set a field value, so I don't think it is interfering.

Does anyone know what this might be?


There has been an error while loading the form - The following file is not a valid InfoPath form tem



We’re experiencing quite an odd issue with opening forms within a SharePoint form library. These are the symptoms;

We recently published a newer version of an InfoPath form, and have since received some feedback that the form no longer opens in the “View Properties” view of SharePoint.

Rather interesting though, within the standard view all form instances can be opened with no problem.

The reason this has to work within the “View Properties” view of SharePoint is because we have a workflow that is sent, with a link to this particular page.

This is the error message that is displayed;


There has been an error while

filling current user name in people picker field when loading form using javascript


Hello guys,

I am looking is there any way to fill the current user's name in people picker field in newform.aspx using javascript?

If you anything, please let me know 


edit form page loading is slow with more fields in foundation 2010


Hi friends,

I have recently noticed that ,my list edit form page load time is more compare to old version .

I have migrated my sharepoint site from wss3.0 to foundation 2010. I have a large list with 15,000 items and 43 fields.

My new item form is loading very quickly but edit form taking more than a minute. I tried with helath reports and firebug and yslow tools.

I didn't success with any reason. I request you to send me why it happening to the edit form page only

Out of 42 field 12 fields are lookup and I have field edit permissions enabled for different users.

Let me know what can I do to improve page load time for my list edit form.





There has been an error loading the form. MOSS 2007


Receiving this error when viewing a task with out of box approval workflow.

Here is what the Event log shows.


The form template failed to load. (User:domain\username, Form Name: Review, IP: , Request: http://siteList=d57c23fe-011b-4320-9f42-eb0ef0af92af&ID=3531&Source=http://site={9E2961B8-AAE4-4115-9A47-824DA8DCF1BF}&FilterField1=Status&FilterValue1=Not%2520Started&FilterField2=AssignedTo&FilterValue2=Kojetin%252C%2520Gayle, Form ID: urn:schemas-microsoft-com:office:infopath:workflow:ReviewRouting-Review:1033, Type: NullReferenceException, Exception Message: Object reference not set to an instance of an object.)


Any ideas?

Changing form width on loading or ... ??


I have a form for showing short messages to the user while program is running.

I want the form width to fit to the length of the message + some left/right margins.

I set the changing in the Form_Load with this code:

    private void formShortMessageForm_Load(object sender, EventArgs e)
      timer1.Interval = (int)tid;
      timer1.Enabled = true;
      const int margin = 50;
      this.Width = margin + label1.Text.Length * 6 + margin;

 but it don't work - the width does NOT change on the screen - where should I put the "changing-lines" so they do the job = changing the width on the screen ?

Best regards KSor, Denmark

Show wait form while loading another heavy form


Dear All,

I have a situation in my project that is a small and nice popup with loading animated gif should show while loading heavy forms in the application. For that to implement I have used threading concept. I am opening loading splash form in a separate thread and ending it when the main thread notifies that its task is completed. Every thing is working fine but my problem is when the user clicks on the application's forms while splash screen is doing its business the application is hanging.

Please help me on this.The code is as follows

class PleaseWait : IDisposable
        private FrmSplashWait mSplash;
        private Point mLocation;
        private string ttlTxt;

        public PleaseWait(Point location,string ttl)
            mLocation = location;
            ttlTxt = ttl;
            Thread popupthread= new Thread(new ThreadStart(workerThread));

There has been an error while loading the form. A required resource could not be downloaded. To try

Actually i create site and publish some infopath files .I open the infopath form in browser enble and save to particular site.When open it in intranet it ok but when i open it i Internet it give me error as

"There has been an error while loading the form. A required resource could not be downloaded. To try to resume the download, refresh the page."

 the main thing i obserb that while opening the file in internet it redirect to intranet .so change the url according to internet url and i got errror as above .

pradipta nayak

JQuery Validate plugin to validate a ASP.NET Form

The first time I used the JQuery Validate plugin, it did not work at all, see JQuery Validate odd behaviour with the ASP.NET Script Manager for reason, but perseverance and stubbornness prevailed and I finally created my first JQuery validated ASP.NET Forms contact form.

How to use getElementById to get the elements in a form

There are many ways of accessing form elements, of which the easiest is by using the cross-browser W3C DOM document.getElementById method. Before we learn more about this method, it would be useful to know something about the Document Object Model (DOM), the concept of HTML nodes or elements, and the concept of containers.

Each time you load an HTML page, the web browser generates an internal representation of the page in the form of an inverted tree structure. Let us look at a simple form. We will use this form later to demonstrate the use of the getElementById method.

Form view in ASP.NET


hi all...!
i have a database and i create a form with button edit,delete, New Registration..using Formview in asp.net..
everything was working good...

And i write SQL statement to get New ID number into dropdownlist/TextBox when i click button "New Registration".

i can get new(next) ID number after read database
it's also working good

Now i want change it to get ID which was deleted from table and replace the ID with new record...what i need is when i click "New Registration" i want get deleted "ID" first and then go to new record ID...

my code is here:-it working for get next ID after read database.

FROM Table1
AS boon WHERE PANG >300000

form feild hints are not displaying for textboxses inside create user wizard?



I'm using following JS code to display input hint box besides the textbox whenever that asp.net textbox receives focus. 

I'm doing this for a registration form and all of the textboxes are inside the asp.net create user wizard control.

<script type="text/javascript">
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {

function prepareInputsForHints() {
	var inputs = document.getElementsByTagName("TextBox");
	for (var i=0; i<inputs.length; i++){
		// test to see if the hint span exists first
		if (inputs[i].parentNode.getElementsByTagName("span")[0]) {
			// the span exists!  on focus, show the hint
			inputs[i].onfocus = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "inline";
			// when the cursor moves away from the field, hide the hint
			inputs[i].onblur = function () {
				this.parentNode.getElementsByTagName("span")[0].style.display = "none";

How to pass value to another form


Dear experts,

                     I have QuoteNumber filed in Db.aspx(ddquote.txt) i want to pass this QuoteNumber values(values should to another web form/page i.e. mail.aspx when i click mail button, Message should supposed to display in textbox(txtQuote.txt) of mail.aspx form/page is "You are sending "QuoteNumber"  quotation to "MailID", Thanks.




Validate form input - Japanese


 I've searched for several hours and haven't come up with a reference - or even many discussions - of how to go about validating Japanese names, addresses, etc. When I lived in Japan websites, atm's etc. required such info to be entered with the roman alphabet but I've seen some websites that are allowing Kanji/Hiragana/Katakana. I haven't tested many of them for validation but one that I did test (after looking at the page source and discovering no client-side validation) allowed me to put this in the name field: J*=123*go^ Neat!

Any pointers/references? Thanks

Form Filler: Build Workflows to Capture Data and Create Documents


Learn how to create a workflow that uses InfoPath forms and other office documents for passing data to targeted activities and for use in Office documents.

Rick Spiewak

MSDN Magazine June 2008

InfoPath 2007: Designing Form Templates With The New Features Of InfoPath


InfoPath 2007 is an XML forms designer and editor, and a fully featured and integrated member of the Office family. This article takes a sneak peek at some of its new features.

Scott Roberts and Hagen Green

MSDN Magazine August 2006

C++ at Work: Form Validation with Regular Expressions in MFC


I thought I'd use this month's column to describe an interesting app I built using the RegexWrap library described in my article "Wrappers: Use Our ManWrap Library to Get the Best of . NET in Native C++ Code" in this issue.

Paul DiLascia

MSDN Magazine April 2005

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