Search This Blog

Monday, March 7, 2011

How can ues post method when ues Master page in ASP.NET

When use master page then form tag ues in master page but we want post our page from index.asp to index1.aspx in this case ues this code on cs page.

****************************Page index.aspx.cs************************************
protected void Page_Load(object sender, EventArgs e)
{
HtmlForm TEST;
TEST = (HtmlForm)Master.FindControl("form1");
TEST.Method = "post";
TEST.Action = "index1.aspx";
}

********************************Page index.aspx1.cs*******************************************
string textvalur=request("control name);

User Define function for ID

CREATE  FUNCTION [NewID]()
RETURNS varchar(20)
AS

BEGIN
DECLARE @_ggmvalue varchar(30)
DECLARE @_ggmvalue1 varchar(30)
DECLARE @_ggmvalue2 varchar(20)
DECLARE @_ggmmilisec varchar(5)
DECLARE @lengthmilisec varchar(5)
DECLARE @_TtmPrefix varchar(16)
DECLARE @_TtmSufix int
DECLARE @_TtmId varchar(22)
DECLARE @length int



select @_ggmvalue1=convert(varchar(10),get_ggm(),112)+convert(varchar(10),get_ggm(),108)
select @_ggmmilisec=convert(varchar(10),_ggmPART(ms,get_ggm()))
set @length=Len(@_ggmmilisec)
if(@length<2)
begin
set @_ggmmilisec='000'+@_ggmmilisec

end
if(@length<3 and @length>=2)
begin
set @_ggmmilisec='00'+@_ggmmilisec

end
if(@length<4 and @length>=3)
begin
set @_ggmmilisec='0'+@_ggmmilisec

end
if(@length>=4)
begin
set @_ggmmilisec=@_ggmmilisec

end
select @_ggmvalue=@_ggmvalue1+@_ggmmilisec
select @_ggmvalue2= Replace(@_ggmvalue,':','')
select @_TtmSufix=Number from randomNumber
select @_TtmPrefix=Substring(@_ggmvalue2,3,18)
set @_TtmId=@_TtmPrefix+convert(varchar(6),@_TtmSufix)
return @_TtmId

END
GO