Hi Everyone,

I am programming an ordering site in VB.Net and ASP.Net.

I start with the main ordering form and the idea is that the user will select a subject from the drop down list and then click a button to retrieve all modules associated with that subject in a second form (smaller than the main order form).

I have created the second form (frm2) and added content to it.

In the main form inside the method which represents the button being clicked, I have coded the following:

Dim frm As New frm2()

frm.show()

I then get an error that show has not been declared and so I create a method stub for it.

I run the program and when I click on the button I get the following error:

'method or operation is not implemented.'

This points to the following line in the 2nd form:

Sub show()
        Throw New NotImplementedException
End Sub

Does anybody know what I need to put inside this method to make my second form load when the button is clicked?

Any help would be much appreciated.

Thanks,

Dan

You shouldn't need to create your own Show method. The correct method is Show() - uppercase but the IDE should have corrected that for you. Delete the show() method you created, change the code in form1 to Show() and it should work.

I have deleted the show method from the second form, gone back to the first form and changed it to Show().

I get a message saying that Show is not a member of ProjectName.FormName.

Can you please explain what I am doing wrong?

Maybe you should post up some code so we can see what you've done.
Although in your previous post you have

Dim frm As New frm2()

That should probably be

Dim frm As New Form()

I assumed that was a mistake but maybe it isn't.

This is what I have at the moment:

In the first form I have the method for when the button is clicked:

Protected Sub butGetSubProgrammes_Click(sender As Object, e As EventArgs) Handles butGetSubProgrammes.Click

                Dim sqlConn As New SqlConnection
                Dim sqlCmd As New SqlClient.SqlCommand
                Dim sqlReader As SqlDataReader
                Dim sqlAdapter As New SqlDataAdapter
                Dim sqlDataTable As New DataTable

                Dim frm As New SubProgrammeSelection()
                ' Display frmAbout as a modal dialog
                frm.Show()

Please note the SubProgrammeSelection is the 2nd form that I want to load: SubProgrammeSelection.aspx.

Thanks,

Dan

as u are also using asp.net the show method dont go with it....

response.redirect is the method to redirect it to the other form in asp.net

Oh right...ok that makes sense.

Is there a way to do a response.redirect but making the new form smaller (smaller height and width) as well as keeping the 1st form alive as I still want the data from the first form to be kept in memory and not have to be re-provided??

Many thanks,

Dan

hope this helps u

System.Text.StringBuilder sb = new System.Text.StringBuilder();
        sb.Append(<script language='javascript'>");
        sb.Append("window.open('Default2.aspx', 'CustomPopUp',");
        sb.Append('top=0, left=0, width=500, height=500, menubar=yes,toolbar=yes,status=1,resizable=yes'));

        sb.Append("</script>");

I have integrated the above code and am not getting anything appear:

Dim sb As New System.Text.StringBuilder
                sb.Append("<script language='javascript'>")
                sb.Append("window.open('SubProgrammeSelection.aspx', 'CustomPopUp',")
                sb.Append("top=0, left=0, width=500, height=500, menubar=yes,toolbar=yes,status=1,resizable=yes")
                sb.Append("</script")

Can somebody please help?

Write the below part in ur html source code of the button

 <asp:Button ID="Button1" runat="server" Text="Button" Width="141px"  OnClientClick="window.open('WebForm1.aspx', 'OtherPage','top=0, left=0, width=500, height=500, menubar=yes,toolbar=yes,status=1,resizable=yes');"/>

Thank you,

That worked :-)

One more question on this...when this smaller form loads up, I want to be able to show a gridview records from a database based on the value selected from the drop down list box.

I am guessing I would need to store the value of the selected item in a variable and pass it on to the next form but would this be done within the HTML or would I need to create a method for the button and put the code in to there?

Many thanks,

Dan

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.