Site Search:
Sign in | Join | Help
4Penny.net

ASP.NET

Notes, Tricks and Tips on ASP.NET Coding

February 2007 - Posts

  • Including '.lic' files in the new Web Deployment Projects

    Recently Microsoft announced 'Web Deployment Projects', and I'm really liking the whole concept. There is a lot of stuff on http://weblogs.asp.net/scottgu/default.aspx, but one thing that I had a hard time finding was how to include '.lic' (license)files in my project. Thanks to 'Girijesh' for pointing me in the right direction.

     After spending some time on forums.asp.net, I found the solution, which I have repeated here so that I don't loose it.

    Just edit your web.config compilation settings:

    <configuration>
    <system.web>
    <compilation>
    <buildProviders>
    <
    remove extension=".lic"/>
    <
    add extension=".lic" type="System.Web.Compilation.ForceCopyBuildProvider"/>
    </
    buildProviders>
    </compilation>
    </SYSTEM.WEB>
    </configuration>


    This will force all *.lic files to be copied when publishing/precompiling your site.

    I found the above at http://ocegtech.blogspot.com/2006_07_01_ocegtech_archive.html, another good read.

     

  • How to Confirm Deletion in a gridview

    This code will confirm that you want to delete a row in a gridview:

    Protected Sub GridView1_RowDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewRowEventArgs) Handles GridView1.RowDataBound

    Dim lnkDelete As LinkButton

    If e.Row.RowType = DataControlRowType.DataRow Then

    lnkDelete = CType(e.Row.FindControl("lnkDelete"), LinkButton)

    Dim strUserName As String

    strUserName = DataBinder.Eval(e.Row.DataItem, "vchrUserName")

    lnkDelete.Attributes.Add("onclick", "BLOCKED SCRIPTreturn confirm('Are you sure you want to delete user " + Chr(34) + strUserName + Chr(34) + "')")

    End If

    End Sub