Tuesday, January 31, 2012

how to create dynamic page using ms sql procedure

Hello Friends ,

This post is  about how to create dynamic page using procedure in asp.net using MS sql procedure .

for that first create the simple .aspx page named as create-dynamic-page.aspx


its content would be like below image












now write down the inline code or page behind code in your page.
your code behind page that is create-dynamic-page.aspx.vb

Let's create one procedure for dynamic page that is very simple





-- exec prc_GetDynamicPageContent               
-- drop proc  prc_GetDynamicPageContent              
create  proc [dbo].[prc_GetDynamicPageContent]              
as              
begin              
 select '<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="create-dynamic-page.aspx.vb" Inherits="default.create_dynamic_page" %>


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
    </div>
    </form>
</body>
</html>'
              
end  


HERE using above procedure it will create dynamic page each time in your code and will use
create-dynamic-page.aspx.vb as code behind so wite down your code in that file.






No comments:

Post a Comment