Showing posts with label populates. Show all posts
Showing posts with label populates. Show all posts

Saturday, March 24, 2012

Please Help DDL

I have code that populated a drop down list and with the users selection in the ddl it populates the text fields. This works fine with one exception

The first record in the Drop Down List doesn't populate at all... Please help....I should explain a little better

Here is a snippett from both pages the user selects the item in the drop down menu then they are rerouted to another page than takes that value and populates the textboxes

Private Sub DropDownList1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DropDownList1.SelectedIndexChanged
Dim mystring As String = DropDownList1.SelectedItem.Text
'passing the variable to the next page
Response.Redirect("WebForm2.aspx?mystring=" & DropDownList1.SelectedValue)
End Sub

' this is the second page where it takes that variable and populates the textboxes
'then I am populating the texboxes based on the selectedtext in a fillbox() function

Sub fillBox()
Dim ds As New DataSet

Dim myCommand As OleDbDataAdapter
Dim smyString As String

'retreiving the variable passed from page 1 using the drop down list
smyString = Request.QueryString("mystring")

'code ot take out an apapostrophe
smyString = Replace(smyString, "'", "''")

sql = "Select * From SiteDocNew where [River/Site Name_en] ='" & smyString & "'"
myCommand = New OleDbDataAdapter(sql, conn)

'Fill command to fill the textboxes
myCommand.Fill(ds, "SiteDocNew")
txtLocationDesc.Text = ds.Tables("SiteDocNew").Rows(0).Item("Location & Access Description_en").ToString()
Is the 2nd page not working?
The second page is working with all other records with the exception of the first record on the drop down list.

And if I do click on the first record the second page does not even open...
Sorry I figured it out I just added a null line in the drop down list...

Friday, March 16, 2012

Please help newb!

I am trying to format the way an asp app populates on the webpage.

The webpage is here:

http://www.merge-efilmknowledgebase.com

The gif at the top and bottom were added to a header and footer .ascx repectively.

I like the way the body will format itself to the size of the browser window.

Is there anyway of doing this with the header and footer gifs as well?

If not, is there a way to proportion the body so that it is always the same width as the header and the footer gifs...maybe insert blank space of some sort?

Cheers!The body is resizing it's self on your site because you have your content tables width set to 100%, this will make the table take up 100% of the browser unless you have it nested inside another table then it will take up 100% of the containing table. You can set the width property to 100% but I wouldn't suggest stretching your gifs because the will look pixelated and crappy. For the footer you could easily replace the image with a table that has it's bgcolor="#000000" and apply a style to your text like <a style="color:#FFFFFF">some text</a> then you could set the width property of the footer table to 100% but I would'nt try and strech any images. You might be screwed on the header.

example:

<table cellpadding="0" cellspacing="0" bgcolor="#000000" or style="color:#000000"width="100%">
<tr>
<td><a style="color:#FFFFFF" href="http://links.10026.com/?link=somesite">click me</a>
</tr>
</table>
Thanks for your reply and help on this one.

I think I will stick with the current format of the header and footer.

Is there anything I can add at the end of the header and / close at the beginning of the footer so the body will no longer take up 100% and instead will format to the same width as the gifs?

Cheers!
you can put everything inside a table with it's width set to whatever width you want like width="768px" and keep your content tables set to width="100%". Then your content tables will take up 100% of the table rather than the browser so they would all ways be 768px or what ever.
Thanks Jeremy123, you helped me fix this one...I am very grateful!