5
Answers

Opening a browser and hiding the address bar, help!

charanya suri

charanya suri

16y
13.2k
1

I am working on a C# .Net project.

I am using the following code to open the browser from my application.

System.Diagnostics.Process process = new System.Diagnostics.Process();

process.StartInfo.UseShellExecute = true;

process.StartInfo.FileName = URL;

process.Start();

Now how can i hide my address bar when the browser opens up for my customers. Please help!!

I even saw this piece of code but i dont know how we pass the URL.

System.Type oType = System.Type.GetTypeFromProgID("InternetExplorer.Application");

object o = System.Activator.CreateInstance(oType);

o.GetType().InvokeMember("menubar", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 0 });

o.GetType().InvokeMember("toolbar", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 0 });

o.GetType().InvokeMember("statusBar", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 0 });

o.GetType().InvokeMember("addressbar", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { 0 });

o.GetType().InvokeMember("Visible", System.Reflection.BindingFlags.SetProperty, null, o, new object[] { true });

 

 

 

 

Answers (5)
0
Sony T

Sony T

NA 10 0 19y

write this in codebehind. This reads the data from the database but u can use the readXml method of the dataset and popluate.

Public
Function PopulateTitle() As DataSet
Dim cn As New SqlConnection
Dim daPricing As SqlDataAdapter
Dim dsPricing As New DataSet
Dim TempList As New DropDownList
Dim myRow As DataRow
cn =
New SqlClient.SqlConnection("ur connection string")
cn.Open()
daPricing =
New SqlDataAdapter("SELECT TITLE, TITLE_ID FROM XYZ ORDER BY TITLE", cn)
daPricing.Fill(dsPricing)
PopulateTitle = dsPricing
dsPricing.Dispose()
daPricing.Dispose()
cn.Close()
End Function

write the following in .aspx
   <asp:TemplateColumn HeaderText="Title">
      <ItemTemplate>
       <asp:Label ID="lblTitle" Text='<%# DataBinder.Eval(Container.DataItem, "TITLE") %>' Runat="server" Width="176px" />
      </ItemTemplate>
      <EditItemTemplate>
       <asp:DropDownList id="ddlTitle" runat="server" DataSource="<%# PopulateTitle %>" DataTextField="TITLE" DataValueField="SERVICE_ID" OnPreRender="setTitle" Width="176px">
       </asp:DropDownList>
      </EditItemTemplate>
     </asp:TemplateColumn>

Method which is highlighted is as follows

Public Sub setTitle(ByVal sender As Object, ByVal e As System.EventArgs)
Dim ddlTitle As DropDownList
ddlTitle = sender
If (Not ddlTitle Is Nothing And strServiceTitle <> "") Then
ddlTitle.ClearSelection()
ddlTitle.Items.FindByText(strServiceTitle).Selected =
True
End If
End Sub

strServiceTitle is:

Public Sub edit(ByVal sender As System.Object, ByVal e As DataGridCommandEventArgs)strServiceTitle = CType(e.Item.FindControl("lbltitle"), Label).Text
End Sub

0
Anuj Paryemalani

Anuj Paryemalani

NA 4 0 19y
Firstly you will have to use the asp:TemplateColumn Use the itemdatabound event of the datagrid In this evnet you will have to check for the ItemType if it is ListItemType.EditItem then you can populate the control of that particular cell. Hope this helps :) Anuj