Home » Applications » ASP.NET » Archive by category "VS2010" (Page 2)

Archive for the 'VS2010' Category

Captcha – VB.NET

Email form <tr> <td></td> <td></td> </tr> <tr> <td></td> <td><img style=”WIDTH: 119px; HEIGHT: 34px” alt=”” src=”Captcha.aspx” />  <a href=””>Can’t Read?</a></td> </tr> <tr> <td></td> <td><asp:textbox runat=”server” ID=”txtcaptcha”></asp:textbox></td> </tr> <tr> <td></td> <asp:ImageButton ID=”ContactSeller” CausesValidation=”True” runat=”server” ImageURL=”/images/buttons/btn_submit.gif” /></td> </tr> Email page code behind …. Dim captchaStr As String = Session(“randomStr”) Dim captchaTxt As TextBox = ContactSeller.FindControl(“txtcaptcha”) If captchaStr captchaTxt.Text.ToString […]

Content Limited by Word Count – VB.NET

Imports System.Text.RegularExpressions Partial Class for_sale_Default Inherits System.Web.UI.Page Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then Dim WordCountInt As Integer = CountWords(DataBinder.Eval(e.Row.DataItem, “description”).ToString) Dim WordCountStr As String = DataBinder.Eval(e.Row.DataItem, “description”).ToString If WordCountInt >= 40 Then Dim iNextSpace As Integer = WordCountStr.LastIndexOf(” “, 175) e.Row.Cells(3).Text = + DataBinder.Eval(e.Row.DataItem, “description”).ToString.Substring(0, iNextSpace) […]

Content Limited by Character Number – VB.NET

Code behind Partial Class _default Inherits System.Web.UI.Page Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As GridViewRowEventArgs) If e.Row.RowType = DataControlRowType.DataRow Then ‘character count If DataBinder.Eval(e.Row.DataItem, “description”).ToString.Length >= 175 Then e.Row.Cells(3).Text = + DataBinder.Eval(e.Row.DataItem, “description”).ToString.Substring(0, 175) + e.Row.Cells(3).ToolTip = DataBinder.Eval(e.Row.DataItem, “description”).ToString Else e.Row.Cells(3).Text = + DataBinder.Eval(e.Row.DataItem, “description”).ToString End If End If End Sub End Class