I have a website where commenting will be allowed across multiple areas.I have created a control so that this commenting feature can be re-used.
I am using a listview for the comments, with an object data source. The object data source select params etc will change depending on the section.
As this will change, it needs to be done programmatically:
However, the TypeCode for UserId which is a GUID is not available, does anyone else know how I could pass this param?
Am i going in the right direction?
I am using a listview for the comments, with an object data source. The object data source select params etc will change depending on the section.
PHP:
<asp:ObjectDataSource ID="objComments" runat="server"
SelectMethod="GetComments" SelectCountMethod="GetCommentsCount" InsertMethod="PostComment"
TypeName="Messages.Messages"
EnablePaging="true" StartRowIndexParameterName="startRowIndex" MaximumRowsParameterName="maximumRows" >
<SelectParameters>
<asp:QueryStringParameter DbType="Guid" Name="UserId" QueryStringField="UserId" />
<asp:Parameter Name="maximumRows" Type="Int32" />
<asp:Parameter Name="startRowIndex" Type="Int32" />
</SelectParameters>
<InsertParameters>
<asp:QueryStringParameter DbType="Guid" Name="RecipientId" QueryStringField="UserId" />
<asp:Parameter Type="Int32" Name="ParentCommentId" ConvertEmptyStringToNull="true" />
<asp:Parameter DbType="Object" Name="CommentType" DefaultValue="Friend" />
</InsertParameters>
</asp:ObjectDataSource>
As this will change, it needs to be done programmatically:
PHP:
ods.ID = "objComments";
ods.TypeName = "Messages.Messages";
ods.SelectMethod = "GetComments";
ods.SelectCountMethod = "GetCommentsCount";
ods.EnablePaging = true;
ods.StartRowIndexParameterName = "startRowIndex";
ods.MaximumRowsParameterName = "maximumRows";
ods.InsertMethod = "PostComment";
ods.SelectParameters.Add("maximumRows", TypeCode.Int32, "10");
ods.SelectParameters.Add("startRowIndex", TypeCode.Int32, "0");
ods.SelectParameters.Add("UserId", TypeCode.SByte, Users.GetCurrentUserId());
However, the TypeCode for UserId which is a GUID is not available, does anyone else know how I could pass this param?
Am i going in the right direction?