|
i think u have to use delegates
T.Balaji
|
|
|
|
|
I created a search page(search.aspx) to get the column name the user want to display and pass them as query string to detail list page(detail.aspx).
In the detail list page, I created a gridview to display those columns. At first, when I created the gridview, I invisible them.
<asp:content id="Content1" contentplaceholderid="phMain" runat="Server" xmlns:asp="#unknown">
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False">
DataKeyNames="autoid" DataSourceID="SqlDataSource1">
<columns> <asp:boundfield datafield="autoid" headertext="ID" insertvisible="False">
ReadOnly="True" SortExpression="autoid" />
<asp:boundfield datafield="name" headertext="Name" sortexpression="name" visible="False">
<asp:boundfield datafield="description" headertext="Description" visible="False">
SortExpression="description" />
<asp:boundfield datafield="typeid" headertext="Type" visible="False">
SortExpression="typeid" />
<asp:boundfield datafield="daterequested" headertext="Date Requested" visible="False">
SortExpression="daterequested" DataFormatString='{0:dd/MMM/yy}"' />
<asp:boundfield datafield="requiredby" headertext="Required By" visible="False">
SortExpression="requiredby" DataFormatString='{0:dd/MMM/yy}"' />
<asp:boundfield datafield="lastupdated" headertext="Last Updated" visible="False">
SortExpression="lastupdated" DataFormatString='{0:dd/MMM/yy}"'/>
<asp:boundfield datafield="lastcomment" headertext="Comment" visible="False">
SortExpression="lastcomment" />
<asp:boundfield datafield="lastupdateby" headertext="Last Update By" visible="False">
SortExpression="lastupdateby" />
<asp:sqldatasource id="SqlDataSource1" runat="server">
ConnectionString="<%$ ConnectionStrings:ConnectionString1 %>"
SelectCommand="SELECT * FROM [tbldetail]
Then, in the Page_Load, I want to visible particular column which pass the string from page before (search.aspx)
protected void Page_Load(object sender, EventArgs e)
{
String selectcolumn = this.Request.QueryString["Selected"];
string[] columnID = commaStringToArray(selectcolumn);
// how to find the datafield of each column and visible them.
}
private string[] commaStringToArray(string strComma)
{
string [] strArray;
strArray = strComma.Split(new char[] {','});
return strArray;
}
In the web, they were all searching the headertext. But, I want to do the datafield.
work
|
|
|
|
|
hi friends,
fine and hope u so...
in my asp.net page i having one server side dropdownlist and html Control textbox.When i am selecting item from dropdownlist,the value in the textbox is cleared why beacuse i used autopostback "true" for dropdownlist item.i want to retain the value of the textbox when i am selecting different items in the dropdownlist...
note : i set EnableViewState="true" inthe dropdownlist ...it is only working if i used runat="sever" in the textbox control...
can u plz help me to solve this prob????..
i am looking forward to hearing from u...
bye..
|
|
|
|
|
dayakar_dn wrote: note : i set EnableViewState="true" inthe dropdownlist ...it is only working if i used runat="sever" in the textbox control...
So, why don't you use it as a server side control?
dayakar_dn wrote: can u plz help me to solve this prob????..
Another option is to store the value of the textbox somewhere and than again populate it after the postback.
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
hi Manas Bhardwaj,
i tried as u said....
i got the value of html textbox in the code behind page
with the help of the following code...
Request.Params["ComapanyName"];
how to populated back this value to the html textbox without using runat="server"...
|
|
|
|
|
Use request object to get value of your html textbox
and populates the control on every postbacks
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hi Friends ,
I have problem regarding creation bin folder in ASP.NET 2.0 which includes .DLL and assemblies for deploying the website.Whenever , I am compiling and running my asp.net 2.0 application , it won't create bin folder in the application.And I want to create bin folder automatically , as like in .NET versio 1.1
Please, suggest me that , what's the solution of this problem?
thanks in advance.
|
|
|
|
|
That is generally known as Precompilation[^].
Please remember to rate helpful or unhelpful answers, it lets us and people reading the forums know if our answers are any good.
|
|
|
|
|
In simple words VS does not create ddl for WebSite
you will have to explicitly create the dll by precompilation process
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
Hello friends,
I am using Report viewer for printing. when my report is displayed on the screen, I need export them to either Excel or PDF to print them. Is it possible to print the report directly (without exporting ) using only one click action..?
Thanks..
|
|
|
|
|
hi all,
i have dropdownlist with values from 1 to 10 and text box where user enters the task details what i have to do i have made auto increament in Dropdownlist value when user submits the task .
for suppose after submitting task one Dropdownlist item get auto increament to next number .
which appraoch would be good ?
Any idea ?
best Regards
Rameez
|
|
|
|
|
<br />
DropDownList1.Items.Add(new ListItem(Convert.ToString(DropDownList1.Items.Count + 1), Convert.ToString(DropDownList1.Items.Count + 1)));
If you have to bind dropdownlist from database then bind it after you add new task.
I Love T-SQL
"Don't torture yourself,let the life to do it for you."
If my post helps you kindly save my time by voting my post.
|
|
|
|
|
So, from what I can find (and there is very little on the subject that I can locate) this control cannot be used to interface with a regular database like the login control can be. It seems to be hard wired to want\need to use the Membership system that is part of ASP.NET .
Is this true? Can anyone either conform or deny this? If I CAN use it with a regular old Access database someone please please please point me in the direction of some decent docs on the subject.
Thanks!
Oh, and before anyone comes back to me about using Access, please don't It's not my fault I am being made to use this poor excuse for a database engine to back an ASP.NET web site.
|
|
|
|
|
Good Evening Guys, Today its my Birthaday.
I have a If statement that i use to return an integer that will mean Success or Failure , now am testing for that integer in my ASP.NET 2.0 Page lke this
if (Res == 1)
{
Response.Write(@"<script> alert('You have Successfully Registred');</script>");
Response.Redirect("login.aspx", false);
}
else
{
Response.Write(@"<script> alert('Invalid Data has been Entered');</script>");
Now if the value is 1, then it should Display the Message and after the Message has been Clicked it should move to the login Page. Now my Problem is that it moves to the Login Page without a Alert Message being Displayed And the send Alert for invalid Entry, will not show anythingm, there is a Warning sign on my Page at the Bootom left of my Page. What is wrong with my Javascript
Thanks
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You can not send two responses to one request, so you can't both have a page containing the Javascript and a page for the redirect. When you do the redirect the current page (where you added the script) is scrapped, and a redirect page is sent instead. So the reason that the alert doesn't show up is that you removed it.
You either have to make the login page show the alert, or do the redirect using Javascript.
When you get a warning sign at the bottom of the page, there is an error message. Double click the warning sign to display the error message.
It's probably because you put the script in the wrong place in the page. You should not use Response.Write at all, unless you take over the responsability for the page completely and write out the entire page with Response.Write. If you use Response.Write to put the script in the page, you will write it before the actual html document, which will keep it from working properly.
Use the ClientScript.RegisterStartupScript method to add scripts to the page.
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
Page.RegisterStartupScript("hai", "alert('hai')")
the above display alert box
your's subbu
|
|
|
|
|
Thanks it works
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
You can do in follwoing way
if (Res == 1)
{
this.ClientScript.RegisterStartupScript(this.GetType(), "key", "myfunction();", true);
)
and in myfunction function just show the alert message and redirect user to Login Page
<script type="text/javascript">
function myfunction()
{
alert('You have Successfully Registred')
window.location.href='Login.aspx';
}
</script>
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
Check My Blog
|
|
|
|
|
hi
Thank you , its working
Vuyiswa Maseko,
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding
VB.NET/SQL7/2000/2005
http://vuyiswamb.007ihost.com
http://Ecadre.007ihost.com
vuyiswam@tshwane.gov.za
|
|
|
|
|
I have a datalist that as two button in item template.i want to when i click on a button get the id of that row.that type of id is char.in witch event I should write this code.
|
|
|
|
|
In the click event for the button ?
Christian Graus
No longer a Microsoft MVP, but still happy to answer your questions.
|
|
|
|
|
ItemCommand . There are more specific event such as UpdateCommand DataList Events[^].
Eslam Afifi
|
|
|
|
|
hello everyone! i've got the following problem.
In web.config i've defined a section
<databaseSettings>
<add key="dataSource" value="someDB.sdf"/>
<add key="password" value="somePass"/>
<add key="connectionString" value="Data Source=<_here_should_be_value_of_dataSource_entry_>;Password=<_and_here_value_of_password_>;"/>
</databaseSettings>
the problem is how values of "dataSource" and "password" entries could be used in "connectionString" (as i've tried to show above). i am using this values in code to manipulate data base file as well as to initiate db connection. thus i need all this entries, and it will be quite handy if any changes in db (e.g. name or pass) will cause changes in only one place in the web.config. can someone help me out with this problem?
thanks
|
|
|
|
|
Hi,
I have an gridview in which I have placed an TEXTBOX.
There are option in the gridview such as accept and reject on both the actions the user will enter some text in the TEXTBOX which will be emailed to the user.
I m doing this on rowcommand event of gridview but I m not able to retrieve the value in the TEXTBOX.
the code is as following
if (e.CommandName == "Accept")
{
int index = Convert.ToInt32(e.CommandArgument);
int id = Convert.ToInt32(GridView1.DataKeys[index].Value);
string tbcomment = ((TextBox)GridView1.Rows[index].FindControl("txtComment")).Text;
TextBox text = (TextBox)GridView1.Rows[index].Cells[8].FindControl("txtId");
Label tb = (Label)GridView1.Rows[index].FindControl("lblId");
Response.Write(tbcomment);
grid_bind();
}
NOT GETTING THE VALUE IN TXTCOMMENT THAT THE USER WILL WRITE.
ANY SUGGESTION?
Vijay V.
Yash Softech
|
|
|
|
|