如何在特定帖子上插入特定评论? (对于例如facebook)在asp.net中使用c# [英] How can i insert particular comment on particular post? (for eg. facebook) in asp.net using c#

查看:54
本文介绍了如何在特定帖子上插入特定评论? (对于例如facebook)在asp.net中使用c#的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在特定帖子上插入特定评论? (比如Facebook)我在sql中有两张桌子



wall => wallid,用户名,帖子

发表评论=>墙壁id ,评论,评论ID

当我手动插入墙壁ID时,它工作正常,但我希望墙壁ID应自动生成到我输入评论的帖子。



在设计部分



How can i insert particular comment on particular post? (like Facebook) i have two table in sql

wall=>wallid, username,post
post comment=>wall id,comment,comment id
when i insert wall id manually, it works fine, but i want that the wall id should be generated automatically to the post i enter comment in.

In design part





< asp:TextBox ID =TextBox1runat =serverHeight =61pxTextMode =MultiLineWidth =271px>

         

< asp:Button ID =Button1runat =serverHeight =37pxText =SubmitWidth =91px OnClick =Button1_Click/>





<asp:TextBox ID="TextBox1" runat="server" Height="61px" TextMode="MultiLine" Width="271px">
        
<asp:Button ID="Button1" runat="server" Height="37px" Text="Submit" Width="91px" OnClick="Button1_Click" />









< asp:ListView ID =ListView1runat =serverDataSourceID =SqlDataSource1>

< itemtemplate>




<asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
<itemtemplate>


Id:

< asp:标签ID =IdLabelrunat =serverText ='<%#Eval(wallId)%> '/>




post:

< asp:Label ID =postLabelrunat =serverText = '<%#Eval(post)%>'/>




用户名:

< asp :Label ID =usernameLabelrunat =serverText ='<%#Eval(username)%>'/>

















< asp:SqlDataSource runat =serverID =SqlDataSource1ConnectionString ='<%$ ConnectionStrings:ConnectionString%> ;'SelectCommand =SELECT * FROM [wall]>


Id:
<asp:Label ID="IdLabel" runat="server" Text='<%# Eval("wallId") %>' />


post:
<asp:Label ID="postLabel" runat="server" Text='<%# Eval("post") %>' />


username:
<asp:Label ID="usernameLabel" runat="server" Text='<%# Eval("username") %>' />










<asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString='<%$ ConnectionStrings:ConnectionString %>' SelectCommand="SELECT * FROM [wall]">

推荐答案

ConnectionStrings:ConnectionString %>'SelectCommand =SELECT * FROM [wall]>

ConnectionStrings:ConnectionString %>' SelectCommand="SELECT * FROM [wall]">


这篇关于如何在特定帖子上插入特定评论? (对于例如facebook)在asp.net中使用c#的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆