. NET

Source: Internet
Author: User

---restore content starts---

Repeater can click inside content to jump and transfer values

<ItemTemplate>
<tr>
<td> <a href= "readarticle1.aspx (address to jump)? id=<% #Eval (" UserID ")%>&articletitle=<% #Eval (" ArticleTitle ")%>" ><% #Eval ("UserID")%></td>
<td> <a href= "readarticle1.aspx (address to jump)? id=<% #Eval (" UserID ")%>&articletitle=<% #Eval (" ArticleTitle ")%>" ><% #Eval ("ArticleTitle")%></a></td>
</tr>
</ItemTemplate>

Add music

<embed src= "/Tong greatly-flying. mp3" (Address information for music) width= "1" height= "1" type= "Audio/mpeg" loop= "true" (whether looping) autostart= "true" (whether AutoPlay) id= "MP3"/>

Page jump and pass value

if (string) sqlhelper.sqlexecutescalar ("Select Userid,userpassword from users WHERE UserID = N '" +userid.text + "' and UserPassword = ' "+userpassword.text +" ' ")!=null)
{
String querystr = Userid.text;
Response.Write ("<script>alert (' login success ') </script>");
Response.Redirect ("http://localhost:20890/personal.aspx?a=" + Querystr + "");
}
Else
{
Response.Write ("<script>alert (' Login failed ') </script>");
}

Accept the Pass value

Userid.text = request.querystring["ID"];
Articletitle.text = request.querystring["ArticleTitle"];

Bind picture (not implemented)

<asp:image id= "Image1" runat= "Server" height= "212px" width= "179px" src= "~\result"/> (Error, implemented with controls in HTML)

SqlConnection conn = new SqlConnection (str);
Userid.text = request.querystring["a"];
Bloglist. DataSource = SQLHELPER.SELECTDT ("select * from author WHERE userid=n '" + userid.text + "'");
Bloglist. DataBind ();
Conn. Open ();
Userid.text = "associates Peng";
String SRCC = "Select UserPicture from Users WHERE userID =n '" + userid.text + "'";
SqlCommand cmd = new SqlCommand (SRCC, conn);
string result = cmd. ExecuteScalar (). ToString ();

---restore content ends---

Title:
<asp:label id= "Articletitlelabel" runat= "Server"/>
<a href = "readarticle.aspx?articletitle=<% #Eval (" ArticleTitle ")%>&authorid=<% #Eval (" UserID ")% >&articleid=<% #Eval ("ArticleID")%> ">
<% #Eval ("ArticleTitle")%>>
</a>
<br/>

Body:
<asp:label id= "Articlecontentlabel" runat= "Server"/>
<%# Eval ("Articlecontent"). ToString (). Substring (0,eval ("Articlecontent"). ToString (). Length >30?30:eval ("Articlecontent"). ToString (). Length)%>
</a>
<BR/>//Body retains the first 30 characters

. NET

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.