|
I need an Access style listbox that will
allow me to format columns like Gridview :
XXXX___YYY__1234
ZZZ____2222__3456
but allow line select so the user can click
anywhere on the line, (like it does now),
unlike Gridview which requires a
"Select button" column(control)
Reccomendations?
Thanks..;)
|
|
|
|
|
Hi
You can use datalist in this case.
1. For displaying data, use SP to concatenate different columns e,g.. col1 + '---' + col2 etc...
2. Set RepeatColumns = "1".
3. If a row is selected, then change the background color of that row using Javascript function. To call javascript function for each cell / row, add an event ItemDataBound of DataList.
I think this is possible...
Rate this message. Thank you. Harini
|
|
|
|
|
Anyone off the top of their head know
a simple way to change the startup page
of a running WEB app? ..My site needs to
come down nightly for maintanance, and I
want users trying to link to get a
maint.aspx page instead of :
default.aspx..using Vis Studio 2005
Thanks..;P
B.Griffin
|
|
|
|
|
I have a method on one of my sites where the pageload in default.aspx checks for the existence of a file (or value in a database, or you could just check for a specific time period, ie between 11pm and 1am). If it finds it, it just does a response.redirect to a "Maintenance.html" page.
You could put that code into a separate class, and call it in the pageload from all aspx pages on the site (rather than just relying on it in the default.aspx page), or even better, put the code into a master page, or a custom page which is inherited by all the other pages.
Just an idea.
|
|
|
|
|
Thanks..!..that's a good idea..I'd gotten so busy
that I fogot somebody could "jump" into the middle
somewhere too!..not just the home page..
a Q:Could I put the check/test into the session start
code so no matter what page they call it goes to
maint.aspx? If so, how would I drop the Access
DB connection so the compact routine has exclusive
access? I could reboot the server, doing the same check
in the app start routine, before the connection is made,
and any attempt to connect would be caught by the session
start code.
B.Griffin
|
|
|
|
|
Your'e right!..I did..it catches the initial link,
but once at my maint page, they can divert to any
page they want by typing it into the address bar!
So I had to take your advice and put a check and
.redirect in the page load of every page..
but, it works!..
Thanks again..you're good deed will come back to you.
|
|
|
|
|
I have usually kept a default.aspx in my project and in the page_load I have a response.redirect to the correct start up page. Seems to work ok for me.
If you don't like that solution you can go to the properties of your web site. Then go to the document tab. Click the add button and type in your start page and make sure it is the page at the top.
Hope that helps.
Ben
|
|
|
|
|
Ben:
Thanks!..I'm gonna `try it.
B.Griffin
|
|
|
|
|
Or before you do nightly maintenance, you could always modify the iis default page properties.....
|
|
|
|
|
Chris:
Will that catch a session start, no matter where
they try to jump into the app?
Thanks,
B.Griffin
|
|
|
|
|
In the Global.asax there is a session start method you can tap into.
Ben
|
|
|
|
|
Your'e right!..I did..it catches the initial link,
but once at my maint page, they can divert to any
page they want by typing it into the address bar!
So I had to take the advice of Chris on this thread
and put a check and .redirect in the page load of
every page..but, it works!..
Thanks again..you're good deed will come back to you.
|
|
|
|
|
Hi,
I have two files, one called vars.php and then the main file. Im trying to include the vars.php in the main file which works yet I have a variable $user = "nicspi_db" and when called in the main file i only get "nicspi" the _db part is cut off... does anyone know why?
Regards
|
|
|
|
|
Not without seeing the code, although I'm sure Bradml will have a million answers off to top of his head
|
|
|
|
|
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Well PHP has an excellent ability to handle this sort of thing so the cause is likely some manipulation of the string via the script. Without you giving me the code I can only suggest that you make sure you have not defined the variable a secound time with the final value.
Otherwise feel free to email me the script and I'll fix it up for you.
Brad
Australian
- Christian Graus on "Best books for VBscript"
A big thick one, so you can whack yourself on the head with it.
|
|
|
|
|
Hi,
Ihave a datagrid that Insert data in some rows. One column has RadioButtonList that contains three Items. But When I select one radiobuton, insert data in other columns and select insert data The radio button unselects itself. Why would this be happening? here is my code.
DataTable table = new DataTable();
private DataTable Fill()
{
SqlDataAdapter adapter = new SqlDataAdapter("select * from dbo.DashBoard", con);
adapter.Fill(table);
return table;
}
private void Bind()
{
dgis.DataSource = table;
dgis.DataBind();
}
private void InsertEmpty()
{
table.Rows.InsertAt(table.NewRow(), 0);
}
private void dgis_ItemCommand(object source,System.Web.UI.WebControls.DataGridCommandEventArgs e)
{
// stop editing
dgis.EditItemIndex = -1;
switch (e.CommandName)
{
case "Insert":
//dgis.EditItemIndex = e.Item.ItemIndex;
break;
case "Update":
System.Web.UI.WebControls.TextBox st=new System.Web.UI.WebControls.TextBox();
st=(System.Web.UI.WebControls.TextBox)e.Item.Cells[5].FindControl("txtobjach");
System.Web.UI.WebControls.TextBox st1=new System.Web.UI.WebControls.TextBox();
st1=(System.Web.UI.WebControls.TextBox)e.Item.Cells[4].FindControl("txtobj");
System.Web.UI.WebControls.TextBox st2=new System.Web.UI.WebControls.TextBox();
st2=(System.Web.UI.WebControls.TextBox)e.Item.Cells[3].Controls[0];
System.Web.UI.WebControls.TextBox st3=new System.Web.UI.WebControls.TextBox();
st3=(System.Web.UI.WebControls.TextBox)e.Item.Cells[2].Controls[0];
System.Web.UI.WebControls.TextBox st4=new System.Web.UI.WebControls.TextBox();
st4=(System.Web.UI.WebControls.TextBox)e.Item.Cells[1].Controls[0];
System.Web.UI.WebControls.RadioButtonList st5=new System.Web.UI.WebControls.RadioButtonList();
st5=(System.Web.UI.WebControls.RadioButtonList)e.Item.Cells[0].FindControl("rblmood");
SqlCommand myCommand=new SqlCommand();
myCommand.Connection=con;
myCommand.CommandText="insert into DashBoard (ObjectiveAchieved,Objective) values (@ObjectiveAchieved, @Objective)";
myCommand.Parameters.Add(new SqlParameter("@ObjectiveAchieved",SqlDbType.Text));
myCommand.Parameters["@ObjectiveAchieved"].Value=st.Text;
myCommand.Parameters.Add(new SqlParameter("@Objective",SqlDbType.Text));
myCommand.Parameters["@Objective"].Value=st1.Text;
myCommand.Parameters.Add(new SqlParameter("@Workinghrs",SqlDbType.Char,45));
myCommand.Parameters["@Workinghrs"].Value=st2.Text;
myCommand.Parameters.Add(new SqlParameter("@Loggedout",SqlDbType.Char,45));
myCommand.Parameters["@Loggedout"].Value=st3.Text;
myCommand.Parameters.Add(new SqlParameter("@Loggedin",SqlDbType.Char,45));
myCommand.Parameters["@Loggedin"].Value=st4.Text;
myCommand.Parameters.Add(new SqlParameter("@MoodToday",SqlDbType.Text));
myCommand.Parameters["@MoodToday"].Value=st5.DataValueField;
con.Open();
myCommand.ExecuteNonQuery();
con.Close();
dgis.EditItemIndex=-1;
BindDataGrid();
break;
case "Cancel":
break;
case "Edit":
// begin editing
dgis.EditItemIndex = e.Item.ItemIndex;
EditCommandColumn ecc = (EditCommandColumn) dgis.Columns[6];
ecc.UpdateText = "Insert";
//dgis.EditItemIndex = e.Item.ItemIndex;
break;
}
// fill and bind
Fill();
InsertEmpty();
Bind();
}
Thanks.
|
|
|
|
|
Dear All,
I am working on WSE and i have done well with WSE routing sample. In my sample the router service re directs a request to another service succesfully. Now i want to know whether a single router can redirect two different requests for two different services to the concern services. My intention is that request for Service1 and Service2 have to be redirected bby a single router. If it is possible, how to achieve this.
Awaiting the reply.
Ramesh.Kanjinghat
|
|
|
|
|
Hi
I am having trouble formatting my 'asp:Textbox' control.
It is viewed fine with IE, but the NOT with FireFox.
Any ideas ?
Thank you
Harkulwant
|
|
|
|
|
Whats wrong with it in Firefox? Can you post the markup for it?
|
|
|
|
|
cascaded dropdown listbox
hi.
i am developing a web based application in Visual WeB Developer EXPRESS.
I have a Drop down list that which is statically filled. Now i wanted that wen i select a particular field from the Drop Down List, a table of the same name shud be accessed, and a particular column be filled in the Listbox Control.
i wrote a piece of code
try
{
conn.Open();
SqlCommand cmd = new SqlCommand();
cmd.Connection = conn;
cmd.CommandText = "Select * from [" + DropDownList1.SelectedValue + "]";+ "'";
SqlDataReader dread = cmd.ExecuteReader();
dread.Read();
while (dread.Read())
{
ListBox1.Items.Add(dread["column_name"].ToString());
}
conn.Close();
the problem is that no row is being retrieved.. please help..
Kunal Piyush
|
|
|
|
|
cmd.CommandText = "Select * from [" + DropDownList1.SelectedValue + "]";
+ "'";
If you've just copied and pasted, then you have 2 statements on the one line. the final +"'"; is a separate statement from the cmd.CommandText .... "]"; statement
Have you tried running your code by entering in a complete dummy sql string just to check it works rather than using the dropdownlist.selectedvalue?
|
|
|
|
|
this is how it is.. it was probably due to modification.. that there was an other statement.
cmd.CommandText = "Select * from [" + DropDownList1.SelectedValue + "]";
i checked with a dummy string.. no retrieval.
also wen i had a string like this
cmd.CommandText = "Select * from '" + DropDownList1.SelectedValue + "'";
it showed an error.. Incorrect syntax near [valuename]
Kunal Piyush
|
|
|
|
|
Hi,
I'm using RadioButtons in datagrid But When I select one I can't unselect it and when I select the others they cannot unselect the other instead they are selected all at once. how could I go about this to be able select one at a time. these Radio button are in one column.
Thanks.
|
|
|
|
|
Radio buttons are grouped by their name attribute, it should be the same for all buttons you want in a group. For an ASP.NET RadioButton control you should set the GroupName property.
|
|
|
|