|
Set PageSize=7 of gridview.
|
|
|
|
|
There are multiple option :
1. You can use Page and Restrict the page limit to 1
2. On RowdataBound, restrict the limit.
Thanks !
|
|
|
|
|
There is a nice controll attribute to add e.g.:
this.buttonAdd.Attributes.Add("onclick", "window.open ('SomePage.aspx','Add','scrollbars=1,resizable=0,width=730,height=580')");
say added during Page_Load.
Can I perform such window.open() by clicking on the button without postback? and opening desired page like SomePage.aspx?param=value
Чесноков
modified on Thursday, August 13, 2009 6:27 AM
|
|
|
|
|
Well just make it
this.buttonAdd.Attributes.Add("onclick", "javascript:window.open ('SomePage.aspx','Add','scrollbars=1,resizable=0,width=730,height=580');return false;");
return false means the page will not be posted back.
|
|
|
|
|
No, the code provided already does not present postback after the button is clicked.
What I need is to click the buttonAdd and to open SomePage.aspx in a new window with params passed to SomePage.aspx as a query string.
After the click on the buttonAdd happen, the page with buttonAdd should not post back.
Чесноков
|
|
|
|
|
yes. The code I provided just does that.
Check if you have correctly applied the code or not.
Just see what I have done:
In designer I wrote :
<asp:Button ID="btnid" runat="server" />
On the server side I wrote :
btnid.Attributes.Add("onclick", "javascript: window.open('testform.aspx', 'download', 'left=1000,top=1000');return false;");
Thus whenever the button is clicked the new window will load the page, and it calls the server but the opener window doesnt post back.
If you want to check just place Response.Write("Testing Postback"); on the OnClick event of btnid. You will see the calling page doesnt write the string.
Hope you understand.
|
|
|
|
|
hiii
i want to populate the listview control from database.
eg.search member and the memberdata get display in listview.
i hav tried but its not workin.plz giv me idea wat to do.
thanks in advance...
regards..
|
|
|
|
|
|
thnks....
it realy helped me....
|
|
|
|
|
|
Hello Everyone, i m building datalist with list of items with multiple small link buttons like reviews, specifications, comparisons etc. and all these are placed on a another single page in Ajax tab Container. and click on button in first page specific tab will be shown on second page...............how to do this....plz guide me
|
|
|
|
|
|
i have a gridview and it works right, but when i write this code: "grv1.AllowPaging = true;" it gives error in binding and the errorMessage is :
"Object reference not set to an instance of an object"
do u know what should i do???
i think it has error in StateFormatter but i dont know what should i do
plz help me
|
|
|
|
|
Can you please paste your databind and paging code?
|
|
|
|
|
private void ReadRss(string path)
{
string rssUrl;
DataSet ds3 = new DataSet();
if (path != "")
rssUrl = path;
else
//rssUrl = "http://jahannews.com/rssdx.gmyefy,ggeltshmci.62ay2x.y.xml";
rssUrl = "http://www.petronet.ir/backend.php";
ds3.ReadXml(rssUrl, XmlReadMode.Auto);
grv1.DataSource = ds3.Tables["item"];
grv1.DataBind();
}
void grv1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
grv1.PageIndex = e.NewPageIndex;
//grv1.PagerTemplate = null;
ReadRss(strPath);
}
when i set grv1.AllowPaging = true i give error in grv1.DataBind();
with this message:Object reference not set to an instance of an object
|
|
|
|
|
http://www.dotnetspider.com/resources/1249-Grid-View-Paging-Sorting.aspx
this may help you.
|
|
|
|
|
Hi all,
Can u tell me Is it possible to get the value of previous page view state value in current page?
eg
page1
viewstate["Name"]="Akash"
response.redirect("page2.aspx")
so in Page2 how can i get the value of viewstate["Name"]?
is it possible? if so how?
Thanks and Regards
Lijo
|
|
|
|
|
Hi,
ViewState is limited to postbacks for single page only.
You can not access value of viewstate of one page from another.
Use session instead.
HTH.
Coding C#
www.excitetemplate.com
|
|
|
|
|
You might start by reading a basic book, so you have some sort of clue about what you're doing.
You have two options:
1 - you can do a cross page postback, where page 1 sets up page 2 to see it's viewstate. This is an ugly hack
2 - you can take your two pages, turn them into controls, show them on the same page, and then they will share viewstate b/c they are the same page.
Christian Graus
Driven to the arms of OSX by Vista.
Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
|
|
|
|
|
How to configure SMTP? My system is connected through LAN.
|
|
|
|
|
|
As i've seen on many site..when u bring cursor to the button it's color changes and a sound is produced..or even dropdown list also appears.
|
|
|
|
|
they all create those elements using css and basic html controls. They dont use the original input control.
Say for example, you can set css background:url('path') using javascript to a div when mouse hovers on it. This will create the the effect that you are talking about.
You can create a dropdown using ul,li and a few divs and css. You need to trap the events.
To do them, you must have knowledge about basic html constructs and javascript.
For time being check Yahoo UI controls. They have already built such controls.
|
|
|
|
|
Following Should be the Code of Object data source in source file
< asp:ObjectDataSource ID="ObjectDataSource1" runat="server" OldValuesParameterFormatString="original_{0}"
SelectMethod="DisplayDoctorsbyId" TypeName="DoctorsBLL"
DeleteMethod="DeletemdnationdoctorsById" >
<selectparameters>
<asp:parameter name="id" defaultvalue="-1" type="Int32">
<asp:parameter name="sLastName" type="string" defaultvalue=" ">
There is store procedure which is called in select method of Object data source it is for displaying data on the basis of search u do
ALTER PROC [dbo].[Proc_DisplaymdnationdoctorsById]
@id int,
@SLastNAME VARCHAR(50)
AS
BEGIN
SET NOCOUNT ON
IF(@id > 0)
BEGIN
SELECT MD.id, MD.FirstName, MD.LastName,MD.MInitial,MD.BirthDate,MD.BirthCity,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.BirthState
) As BirthCountry,
MD.BirthState, MD.BirthNation, MD.StateMedicalBoard, MD.Contact_Address, MD.Contact_City, MD.Contact_State,
MD.Contact_Zip, MD.Contact_Country, MD.Contact_Telephone, MD.Contact_Fax, MD.Cert_Certification, MD.Cert_Date,
MD.Cert_Expires, MD.Cert_ReCertification, MD.Cert_SubCertification,MD.Cert_SubCertificationDate,
MD.Cert_SubCertification_Expires, MD.Cert_Recapitulation, MD.Edu_Degree, MD.Edu_School, MD.Edu_SchoolYears,
MD.Fell_Specialty1, MD.Fell_Organization1,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Fell_State1
) As Fell_Country1,
MD.Fell_State1, MD.Fell_City1, MD.Fell_CareerYears1, MD.Fell_Specialty2, MD.Fell_Organization2,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Fell_State2
) As Fell_Country2,
MD.Fell_State2, MD.Fell_City2, MD.Fell_CareerYears2, MD.Fell_Specialty3, MD.Fell_Organization3,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Fell_State3
) As Fell_Country3,
MD.Fell_State3, MD.Fell_City3,MD.Fell_CareerYears3, MD.Res_Specialty1, MD.Res_Organization1,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Res_State1
) As Res_Country1,
MD.Res_State1, MD.Res_City1, MD.Res_CareerYears1, MD.Res_Specialty2, MD.Res_Organization2,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Res_State2
) As Res_Country2,
MD.Res_State2, MD.Res_City2, MD.Res_CareerYears2, MD.Res_Specialty3, MD.Res_Organization3,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Res_State3
) As Res_Country3,
MD.Res_State3, Res_City3, MD.Res_CareerYears3, MD.Inter_Organization,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Inter_State
) As Inter_Country,
MD.Inter_State, MD.Inter_City, MD.Inter_CareerYears, MD.Mem_Memberships1, MD.Mem_Awards1,
MD.Mem_Publication1, MD.Mem_Memberships2, MD.Mem_Awards2, MD.Mem_Publication2, MD.Mem_Memberships3,
MD.Mem_Awards3, MD.Mem_Publication3, MD.Mem_Memberships4, MD.Mem_Awards4, MD.Mem_Publication4,
MD.Mem_Memberships5, MD.Mem_Awards5, MD.Mem_Publication5, MD.Mem_Memberships6, MD.Mem_Awards6,
MD.Mem_Publication6, MD.Mem_Memberships7, MD.Mem_Awards7, MD.Mem_Publication7, MD.Mem_Memberships8,
MD.Mem_Awards8, MD.Mem_Publication8, MD.Mem_Memberships9, MD.Mem_Awards9, MD.Mem_Publication9,
MD.Mem_Memberships10, MD.Mem_Awards10, MD.Mem_Publication10, MD.sysdate, MD.Special_Expertise
FROM mdnation_doctors MD WHERE MD.id = @id AND MD.LASTNAME LIKE ''+ltrim(rtrim(@SLastNAME))+'%'
END
else
BEGIN
SELECT MD.id, MD.FirstName, MD.LastName,MD.MInitial,MD.BirthDate,MD.BirthCity,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.BirthState
) As BirthCountry,
MD.BirthState, MD.BirthNation, MD.StateMedicalBoard, MD.Contact_Address, MD.Contact_City, MD.Contact_State,
MD.Contact_Zip, MD.Contact_Country, MD.Contact_Telephone, MD.Contact_Fax, MD.Cert_Certification, MD.Cert_Date,
MD.Cert_Expires, MD.Cert_ReCertification, MD.Cert_SubCertification,MD.Cert_SubCertificationDate,
MD.Cert_SubCertification_Expires, MD.Cert_Recapitulation, MD.Edu_Degree, MD.Edu_School, MD.Edu_SchoolYears,
MD.Fell_Specialty1, MD.Fell_Organization1,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Fell_State1
) As Fell_Country1,
MD.Fell_State1, MD.Fell_City1, MD.Fell_CareerYears1, MD.Fell_Specialty2, MD.Fell_Organization2,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Fell_State2
) As Fell_Country2,
MD.Fell_State2, MD.Fell_City2, MD.Fell_CareerYears2, MD.Fell_Specialty3, MD.Fell_Organization3,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Fell_State3
) As Fell_Country3,
MD.Fell_State3, MD.Fell_City3,MD.Fell_CareerYears3, MD.Res_Specialty1, MD.Res_Organization1,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Res_State1
) As Res_Country1,
MD.Res_State1, MD.Res_City1, MD.Res_CareerYears1, MD.Res_Specialty2, MD.Res_Organization2,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Res_State2
) As Res_Country2,
MD.Res_State2, MD.Res_City2, MD.Res_CareerYears2, MD.Res_Specialty3, MD.Res_Organization3,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Res_State3
) As Res_Country3,
MD.Res_State3, Res_City3, MD.Res_CareerYears3, MD.Inter_Organization,
(select Countries_name from countries MC
Inner Join mdnation_states MS on MS.Countries_id = MC.Countries_id
Where MS.state_name = MD.Inter_State
) As Inter_Country,
MD.Inter_State, MD.Inter_City, MD.Inter_CareerYears, MD.Mem_Memberships1, MD.Mem_Awards1,
MD.Mem_Publication1, MD.Mem_Memberships2, MD.Mem_Awards2, MD.Mem_Publication2, MD.Mem_Memberships3,
MD.Mem_Awards3, MD.Mem_Publication3, MD.Mem_Memberships4, MD.Mem_Awards4, MD.Mem_Publication4,
MD.Mem_Memberships5, MD.Mem_Awards5, MD.Mem_Publication5, MD.Mem_Memberships6, MD.Mem_Awards6,
MD.Mem_Publication6, MD.Mem_Memberships7, MD.Mem_Awards7, MD.Mem_Publication7, MD.Mem_Memberships8,
MD.Mem_Awards8, MD.Mem_Publication8, MD.Mem_Memberships9, MD.Mem_Awards9, MD.Mem_Publication9,
MD.Mem_Memberships10, MD.Mem_Awards10, MD.Mem_Publication10, MD.sysdate, MD.Special_Expertise
FROM mdnation_doctors MD WHERE MD.LASTNAME LIKE ''+ltrim(rtrim(@SLastNAME))+'%'
END
END
This Should come under cs file on button click, add text box though to enter the text you want to search
if (tbPhysicians.Text.Trim() != "")
{
//ObjectDataSource1.FilterExpression="LastName LIKE '%" + tbPhysicians.Text + "%'";
ObjectDataSource1.SelectParameters["id"].DefaultValue = "-1";
ObjectDataSource1.SelectParameters["slastname"].DefaultValue = DoctorName;
}
else
{
ObjectDataSource1.SelectParameters["id"].DefaultValue = "-1";
ObjectDataSource1.SelectParameters["slastname"].DefaultValue = " ";
}
ObjectDataSource1.DataBind();
|
|
|
|
|
i want to add two values in a textboxs without using any button it show sum in another textbox how it is possible? i write this function ontextChanged of textbox2 which gets my second value. this code not works.
<asp:TextBox ID="TextBox2" runat="server" OnTextChanged="MySub"
style="top: 267px; left: 585px; position: absolute; height: 22px; width: 128px"></asp:TextBox>
<asp:TextBox ID="TextBox3" runat="server"
style="top: 216px; left: 443px; position: absolute; height: 22px; width: 128px"></asp:TextBox>
<asp:TextBox ID="TextBox4" runat="server"
style="top: 243px; left: 441px; position: absolute; height: 22px; width: 128px">5</asp:TextBox>
<script runat="server" language ="C#">
void MySub(object sender, EventArgs e)
{
int a =Convert .ToInt32 (TextBox3.Text.Trim ()) + Convert .ToInt32 (TextBox4.Text.Trim ());
TextBox2.Text = (a.ToString ());
}
</script>
|
|
|
|
|