Okay in asp I could use <%# =strMessage%> or something like it in an html
page. My issue right now is I have a repeater control that outputs records
in a dataset when a user does a search. It looks sorta like this:


Link to a profile
age: age
Location: location here
last updated: here


The username link to profile is a  problem. In asp I would just make a link
in the html page and the dynamic part I would just put a
href"http://www.blahblah.com?username=<%# =strUsername%>" and then that was
it. I asp.net I can't. I have been trying different things in the repeater
control but I get strange things like the code won't even run or something.
I will click the search button and nothing not even the response.write
statement will run???? I put a Response.Write("its Posted back now") in
there to show up so I know I clicked the button and that the code ran. It
seems to not even run that line at times. Other times it shows up???? Here
is the page http://www.citimatch.com and click on search. All im doing now
is outputting a few records just to get the view of it right. My problem is
making the link dynamically according to the username and any time I edit
the page then its potluck if anything happens after clicking search and not
even the Response.Write("its Posted back now") even shows up sometimes.....
That part I don't get.


  Here is the code:


Private Sub ButtonSubmitSearch_Click(ByVal sender As System.Object, ByVal e
As System.EventArgs) Handles ButtonSubmitSearch.Click

        Response.Write("its Posted back now")
        PanelSearch.Visible = False
        PanelSearchResults.Visible = True
        PanelSearchNoRecords.Visible = False

        'Setup Variables
        Dim strGender
        Dim strSeeking
        Dim strMin_age
        Dim strMax_age
        Dim strS_state
        Dim strZipcode
        Dim strS_country


        Dim strPasswordTest
        strPasswordTest = "xxxxx"

        'Build SQL String
        Dim strSQLstring As String
        'strSQLstring = "SELECT * FROM users WHERE [Username] = '" &
strUsernameSession & "' And [Password] = '" & strPasswordSession & "'"
        strSQLstring = "SELECT * FROM users WHERE [Password] = '" &
strPasswordTest & "' ORDER BY username"


        'Open the Connection -------------------------------------
        Dim objConn As SqlConnection
        Dim objConnString As String = "Data Source=localhost;Initial
Catalog=dating;User Id=dating123;Password=dating123;"
        objConn = New SqlClient.SqlConnection(objConnString)
        objConn.Open()

        'Create a DataSet ----------------------------------------
        Dim objDataSet As New DataSet
        'Create a DataSet ----------------------------------------

        'Create a DataAdapter ------------------------------------
        Dim objDataAdapter As SqlDataAdapter
        objDataAdapter = New SqlDataAdapter(strSQLstring, objConn)
        objDataAdapter.Fill(objDataSet, "users")
        'Create a DataAdapter ------------------------------------


        'CODE
===============================================================
        RepeaterListMembers.DataSource = objDataSet
        RepeaterListMembers.DataBind()
        'CODE
===============================================================


        'Close things up ------------------------------------
        objDataSet.Dispose()
        objDataSet = Nothing

        objDataAdapter = Nothing

        objConn.Close()
        objConn = Nothing
        'Close things up ------------------------------------




<asp:Repeater id="RepeaterListMembers" runat="server">
        
<ItemTemplate>
        
<TABLE id="table123" cellPadding="0" width="519" border="0">
        
<TR>
        
<TD width="156"><IMG height="150" src="images/Photos/nophoto.gif"
width="150" border="0"></TD>
        
<TD>
        
<DIV align="center">
        
<TABLE id="table124" cellPadding="0" width="100%" border="0">
        
<TR>
        
<TD>&nbsp;
        
</TD>
        
</TR>
        
<TR>
        
<TD>Username link here
        
</TD>
        
</TR>
        
<TR>
        
<TD><FONT face="Verdana" size="2">Age:
        
<%# DataBinder.Eval(Container.DataItem, "age") %>
        
</FONT>
        
</TD>
        
</TR>
        
<TR>
        
<TD><FONT face="Verdana" size="2">Location:
        
<%# DataBinder.Eval(Container.DataItem, "City") %>
        
,
        
<%# DataBinder.Eval(Container.DataItem, "State") %>
        
,
        
<%# DataBinder.Eval(Container.DataItem, "Country") %>
        
</FONT>
        
</TD>
        
</TR>
        
<TR>
        
<TD><FONT face="Verdana" size="2">Profile Last Updated:
        
<%# DataBinder.Eval(Container.DataItem, "p_updated") %>
        
</FONT>
        
</TD>
        
</TR>
        
<TR>
        
<TD>&nbsp;&nbsp;
        
</TD>
        
</TR>
        
</TABLE>
        
</DIV>
        
</TD>
        
</TR>
        
</TABLE>
        
<br>
        
</ItemTemplate>
        
</asp:Repeater>




 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/AspNetAnyQuestionIsOk/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to