Click here to Skip to main content
15,906,708 members
Please Sign up or sign in to vote.
1.44/5 (2 votes)
See more:
Hi There,

Please tell me how to send data from windows vb.net form to a website and save data on website using vb.net. I have used webbrowser control but there is one (window.showdailog ) new window, i am not able handle it, please halp me out s ther any other way to transer data from windows from to web site.
Posted
Comments
karthik Udhayakumar 22-May-14 12:27pm    
Nira,
Post your code and explain where you are stuck up:)
nira.parmar 23-May-14 4:46am    
Hi Karthy,

below is my code

Private Sub WBrowser_DocumentCompleted(sender As System.Object, e As System.Windows.Forms.WebBrowserDocumentCompletedEventArgs) Handles WBrowser.DocumentCompleted
WBrowser.ScriptErrorsSuppressed = True
If dtgrd.Rows.Count > 1 Then

WBrowser.Document.Window.Frames(1).Document.GetElementById("lbNavigation$ctl00$QuickSearch1$txtBillNumber").InnerText = dtgrd.Rows(rowid).Cells(0).Value
WBrowser.Document.Window.Frames(1).Document.GetElementById("lbNavigation$ctl00$QuickSearch1$drsQSDates$txtDateRangeStart").InnerText = "02/10/2013"
billcode = WBrowser.Document.Window.Frames(2).Document.Window.Frames(3).Document.GetElementById("ctl00_ContentPlaceHolder1_pnlHeaderDetail_txtHBKey").DomElement.value.ToString
' UserName = WBrowser.Document.Window.Frames(2).Document.Window.Frames(3).Document.GetElementById("LblUserName").DomElement.value.ToString
WBrowser.Document.Window.Frames(2).Document.Window.Frames(3).Document.GetElementById("ctl00_ContentPlaceHolder1_pnlStatus_btnAddStatus").DomElement.Click()
'WaitForPageLoad()
'WebBrowser1.Navigate("http://navigator.cevalogistics.com/ModalDialogs/AddStatuses.aspx?BillType=1&BillKeys=" & billcode)
WebBrowser1.Navigate("http://navigator.uat.logistics.corp/ModalDialogs/AddStatuses.aspx?BillType=1&BillKeys=" & billcode)
WaitForPageLoad2()
Else
If UserName = Nothing Then
UserName = WBrowser.Document.Window.Frames(2).Document.GetElementById("DivHome").Document.Window.Frames("IfrHome").Document.GetElementById("LblUserName").InnerHtml
End If

End If


End Sub
Problem is when this WBrowser.Document.Window.Frames(2).Document.Window.Frames(3).Document.GetElementById("ctl00_ContentPlaceHolder1_pnlStatus_btnAddStatus").DomElement.Click() click event get fired new popup window get opened and I want to access control of this window but I am not able to do that please help me...

1 solution

CSS
Hi,
before ask questions do google search you can get all your answers there chk this links :

http://stackoverflow.com/questions/13913192/how-to-post-data-to-a-website-through-win-forms-c-sharp

http://www.codeproject.com/Questions/301508/How-can-We-post-the-Data-Form-csharp-Winform-To-We

http://forums.asp.net/t/1291722.aspx?Pass+values+from+winform+to+webform

http://stackoverflow.com/questions/13901908/send-data-from-web-form-to-winforms

http://social.msdn.microsoft.com/Forums/vstudio/en-US/da3d1180-5cbd-401e-bf13-cdc821433ff8/passing-data-between-winforms-and-webforms?forum=vbgeneral
 
Share this answer
 
Comments
nira.parmar 23-May-14 4:40am    
I have did lot of Google but didn't get solution, that's why Posted question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900