Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PostBack returning PDF

Status
Not open for further replies.

Kizmet178

Programmer
Jul 22, 2009
3
GB
Hi

I have created a usercontrol on my site this usercontrol consists of 4 dropdownlists. The 1st dropdrownlist when selected populates the 2nd dropdownlist (see below for an extract of the ascx file and the ascx.vb)

<div id="returnMarque" class="body">
<asp:Label Width="50px" ID="lblMarque" runat="server" Text="Marque:"></asp:Label>
<asp:DropDownList CssClass="body" ID="ddlMarque" runat="server" DataSourceID="MarqueDataSource" DataTextField="MarqueName" DataValueField="MarqueID" AutoPostBack="true" >
</asp:DropDownList>
<asp:SqlDataSource ID="MarqueDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:WestsRenaultConnection %>"
SelectCommand="GetAllMarques" SelectCommandType="StoredProcedure"></asp:SqlDataSource>
</div>

Protected Sub ddlMarque_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles ddlMarque.SelectedIndexChanged
FillModel()
End Sub

Private Sub FillModel()
ddlModel.DataSource = GetModels(Integer.Parse(ddlMarque.SelectedValue))
ddlModel.DataTextField = "ModelName"
ddlModel.DataValueField = "ModelName"
ddlModel.DataBind()
End Sub

This all works fine but when I plug it into my main page when I select from the 1st dropdownlist it loads a PDF file. (There is reference to the PDF file in code when a user clicks a link).

Have you got any ideas as to why this may be happening and how this issue can be resolved.

Many Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top