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


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

how to pass string value from a form to the other form (C# 2008)

Posted By:      Posted Date: October 22, 2010    Points: 0   Category :Windows Application
 

hey guys, i just wondering if you could help me with my problem. uhm ok here.. i have Fmain(form1) and FhtmlCSS(form2) and i want to pass a string

from FhtmlCSS(form2) to Fmain(form1). i tried different ways but the string i pass to form1 wont appear in textbox.. i checked the string by using messagebox to see if its null or not and yes its not null. i dont know whats the problem with my code, i hope someone could help me.

heres my code:

FhtmlCSS(form2):

        private void HtmlBox_body_TextChanged(object sender, EventArgs e)

        {

            string current_source = HtmlBox_body.Text;

            StreamWriter stream = new StreamWriter("index.html");

 

            stream.Write(current_source);

            stream.Close();

 

            string place = Directory.GetCurrentDirectory();

            string url = place + "/index.html";

 

            Fmain main = new Fmain();

 


View Complete Post


More Related Resource Links

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.

 

 

 


where did i put this in web form using visual studio 2008?

  
(1)Connection String Sql connection conn=new SqlConnetion ("Data Soure=_______; InitialCatalog=_______;integrated Security = "TRUE"); (2)Binding a control SqlCommand=new SqlCommand ("SELECT STATEMENT", Connection String); SqlDataAdapter da=new SqlDataAdapter(comm); DataSet ds=new DataSet(); da.fill(ds); checkedListBox1.DataSource=ds.Tables[0]; checkedListBox1.DisplayMember="_____"; checkedListBox1.ValueMember="_____";

Javascript to pass var in iframe to parent form

  
Why doesn't this form work when the button is clicked? It is inside an iframe. I sent the controls to an iframe from  a different website. When I hover my mouse over the Resubmit button, I can see the correct url in my browser bar. (lower left) This is the same one as the save button. Does the fact that the Resbmit button is in an iframe create a problem?  Is this a security issue?   I was trying to use the Copy url to clipboard button to copy the selected url in the dropdown to the clipboard. Then the user could paste it into the Recipcocal url field in the form and click the Save button again. (see picture) The form is on the page with the iframe. The copy button doesn't work either.  <form name="ctl01" method="post" action="http://www.link-exchangers.com/adv_links_addbycustomer.aspx" id="ctl01" target="hdnFrm"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUaUXIyTcD6f05q0zIbv4QVbpto4s=" /> </div> <div> <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION" value="//2DwKU+M6MDwK8m8+dCQKy8rjSBwLD+aWMBALcwYfHCALrp+eHDwKggI3ODAKvtqqBBgKjs8y4CAKqiLHeDgK34agCBNfAteTeI3XoiXVXjCs/J0yEnNM=" /> </div>

How to read a column of a sharepoint list to a text string field of infopath form?

  
My infopath form used to read these email addresses from a web service and web.config file. Now i would like to get these user email addresses from a contact list in a sharepoint server. I am trying to do this without writing any codes. Here is what i have done so far: 1. Adding a new "data connection to receive data from SharePoint library or List" where i selected Email Address column of the contact list. 2. I added a new Text Field and define a new rule with "Query using a data connection" defined above. When i try to access the newly created Text field above it always return empty as if the Query attached to it did not executed at all. What did i do wrong? Is there a better way? Thank you in advance for your help.

error in MVC2 on empty string form fields which are required: "This property cannot be set to a null

  
In model I have:[DisplayName("ISBN")] [Required(ErrorMessage = "ISBN is required.")] [StringLength(50, ErrorMessage = "ISBN book must have max {1} chars.")] [DisplayFormat(ConvertEmptyStringToNull = false)] public string isbn { get; set; }But when I submit form with empty field ISBN I have an error - ConstraintException: This property cannot be set to a null value.I have find that other people have the same problem and they say that debbugger in VS2010 works wrong - yes ?http://p2p.wrox.com/book-professional-asp-net-mvc-2/79788-constraintexception-unhandled-user-code.html#post259245http://efreedom.com/Question/1-3129080/Server-Side-Validation-REQUIRED-String-Property-MVC2-Entity-Framework-Workhttp://mvcmusicstore.codeplex.com/workitem/6604

Form Action Button to pass parameters through URL and how to fill a NewForm with them

  
Hi I'm trying to solve a bigger problem we have in babysteps, and I guess after days of searching and trying I simply need to ask for help. The big picture is, that we're trying to put a Form Action Button (via Sharepoint Designer 2007) above a custom DataForm DispForm.aspx which is supposed to navigate to a NewForm.aspx where the Title Field is supposed to be prefilled with a parameter from the DispForm and the user should be able to add information to the item before it is saved. I found several explanations from people on the internet, but nothing really worked. The first babystep would be to get the parameter through the button into the url of the new item.   < input type = "button" value = "Zugriff Beantragen" name = "btnFormAction0" onclick = "javascript: {ddwrt:GenFireServerEvent('__redirect={../Zugriff Beantragen 2/NewForm2.aspx?test={ItemID}')}" />   That's the code for my button. Somebody wrote that should definitely work because SharePoint is able to replace {ItemID} with the actual ID of the item. Well.... it kind of doesn't. What I get as the end of the new URL is exactly "...?test={ItemID}"   I tried with different names for the ID, I added an @ before those ... no change. I read somewhere about javascript.functionName() which should work with all parameters of the item, but

How to create a SSIS package to import records form SQl Server 2008 tables to text files

  
I am a newbie to SSIS and would like to create a package to accomplish the task referenced in the above title. Will appreciate any links and pointers in the right direction.   Thanksakoranteng

VBNET2008 Pass a FORM NAME to another FORM

  
Hi Good Guys, Being requested by Development Manager that of the 3 FORMs,  FrmSales, FrmTrans, FrmShip which load FRMCustomer , passed the name of the Calling Form to FRMCustomer which will set the Calling Form visible = false.  I am having problem passing the callng form name to FRMCustomer and set the calling Form visible = false Here are the coding of Calling Form and Load Form FrmCustomer '-------------------------------------------------------------- ' FORM                   : FRMSALES.VB ' Description  : This form load FrmCustomer to retrieve '                   specific customer                     or Create New Customer '----------------------------------------------------------------    Private Sub  ToolStripMenuItem_Click(ByVal sender As System.Object, _                         ByVal e As System.EventArgs) _                        Handle

VBNET2008 Pass a FORM NAME to another FORM

  
Hi Good Guys, Being requested by Development Manager that of the 3 FORMs,  FrmSales, FrmTrans, FrmShip which load FRMCustomer , passed the name of the Calling Form to FRMCustomer which will set the Calling Form visible = false.  I am having problem passing the callng form name to FRMCustomer and set the calling Form visible = false Here are the coding of Calling Form and Load Form FrmCustomer '-------------------------------------------------------------- ' FORM                   : FRMSALES.VB ' Description  : This form load FrmCustomer to retrieve '                   specific customer                     or Create New Customer '----------------------------------------------------------------    Private Sub  ToolStripMenuItem_Click(ByVal sender As System.Object, _                         ByVal e As System.EventArgs) _                        Handle

The path is not of a legal form - SSCE 3.5 and VS 2008 Server Explorer

  
Hi, I am facing one issue continuously whenever I try to open LocalDatabaseCache(.sdf files) in VS 2008. It says,"The path is not of a legal form". Even if test connection is succeeded. When I restart VS 2008 and DatabaseEngine service then only it opens the Database. Also sometimes I face problem of memory corrupt. May I know what could be the reason for this issue?  How can I permanently resolve it? Regards, Nandkishore    

Restoring Databases form SQL Server 2000 and SQL Server 2005 to SQL Server 2008 -Side by Side --he

  
Hi all I Installed SQL Server 2008 R2 in Server and I took backup of all the User databases backup from 2000 and 2005(two instance are running) Now I am doing restore the Databases,while I am restoring I am information icon in bottom of the restore window that is "The Full-Text Upgrade Option server property controls whether full-text indexes are improved,rebuild or reset" that means I have to upgrade full-text indexes or this just inforamtion.If I want find out whither Database using full-text how to check ? once I done this I have to move the users as well.Please dome body share the script you have.   Thanks in AdvanceSNIVAS

In a workflow, how do I pass the original library url to the task form?

  
Creating a workflow, where I need to display the originating library url (along with document name) in the task form.  I know that the SPWorkflowActivationProperities has the value (its itemurl), but how do I then make that available so that the task can see it? I tried to put it in the extended properties on the task invoking "createDocumentApproval_TaskProperties.ExtendedProperties["MyOriginalUrl"] = workflowProperties.ItemUrl;" but I dont see it when I open the Task form by using a Request.Params. Any help will be greatly appreciated thxRocky Sanders

Setting SharePoint 2010 Form Fields Using Query String Variables

  

Hi All,

I have a requirement to populate sharepoint form field value with query string while uploading document to document library.

While uploading the document to document library, I want to populate claim number available from query string in a pop up page i.e in my case EditForm.aspx, Located at http://servername:port/sitename/documentlibraryname/forms/EditForm.aspx.

Additional Information:

  • Created document library and added custom columns like claim number etc..
  • Created a view to filter uploaded documents as per claim number.

Server Details:

  • Windows Server 2008 R2
  • SharePoint 2010
  • SQL Server 2008 R2

I have written javascript for the same, but not sure where exactly to add the code in EditForm.aspx page.

Any help on this would be greatly appreciated.

Thanking you in advacne.

Regards

Seva


.NET - native interop: how do I pass a .NET form to a native PROPSHEETPAGE

  

Hello

I'm writing a Shell property sheet extension in .NET 4. It requires a PROPSHEETPAGE object. When I construct a PROPSHEETPAGE object in .NET, how do I set its pszTemplate field with a .NET form?


Customize form to add new item - can i pass through a variable?

  

I have a list of issues stored in a SharePoint list.

I now want to store tasks relating to these individual issues.
Ideally, when a user is viewing the issue they can then click on an 'add task' link that will open up a new task, in a standard task list, and pass through the issue id into a custom field.

Any ideas?


How to pass value from browser into embedded windows form control library

  

Hi all,


i have one project which i embed the windows form control library inside the web form.

now i wanna pass a url from aspx into my windows form control library.

May i know how to do this?


thanks.


Workflow with instantiation form in VS 2008 for MOSS 2007

  

Guys. I have a MOSS 2007 install, using VS 2008.

I am trying to create a workflow in VS that simply does the following:

On Start, goes to an instantiation form. This collects one field of data. When this is submitted, the workflow updates a couple of fields, then finished. Sounds easy huh.... It sure is in SPD, but in VS it isn't so easy. I am also following Robert Shelton's blogs on this (if you have seen them).

So I have my workflow project, and for the pages, am putting them in their own folder  in the LAYOUTS within 12 hive.

I am getting an error of

Object reference not set to an instance of an object. at InstantiationForm_InstantiationForm.serializeInstantiationFormDataToXML() , but I can't debug it (even when attaching to W3WP.exe).

My aspx page code:

<%@ Page Language="C#" AutoEventWireup="true" 
     CodeFile="InstantiationForm.aspx.cs&q
Categories: 
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