|
Basically, the different browsers render different CSS differently. You need to work through each issue in your site and find ways to lay it out that work with all browsers. Welcome to hell, sorry.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for reply,
I hope i am not alone in hell...can you direct me from where to start, i am trying and trying and trying but found no solution. what kind of changes i should make in CSS to make it work on every browser...?
any kind of help is appriciated...
Regards,
Affan Ahmad Toor
..................
QUAIDIAN FOR ONCE, QUAIDIAN FOR EVER!
|
|
|
|
|
How to reorder the columns of a databound gridView in run time
|
|
|
|
|
There is nothing built in to do that, you'd have to do it with javascript. Of course, a gridview is a server side construct, it's just spitting out a table on the client end.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
I have created a textbox on button click event :
<code>
protected void btnCreateTextBox_Click(object sender, EventArgs e)
{
TextBox txtDynamic = new TextBox();
txtDynamic.ID = "txtDynamic";
pnlContainer.Controls.Add(txtDynamic);
}
</code>
and when the page loads, i click on the button to load the textbox at runtime, it works fine.
The problem in in fetching the value of the textbox when the user clicks on the "save" button.
I am trying this, but it doesnt works. Since after the postback, there is NO existence of the runtime textbox.
<code>
protected void btnSaveTextBox_Click(object sender, EventArgs e)
{
Response.Write(GetDynamicTextValue());
}
private string GetDynamicTextValue()
{
foreach (Control ctrl in pnlContainer.Controls)
{
if (ctrl.GetType() == typeof(TextBox))
{
return ((TextBox)ctrl).Text;
}
}
return string.Empty;
}
</code>
Here is body of my aspx page
<code>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID=btnCreateTextBox runat=server Text=Create OnClick="btnCreateTextBox_Click" />
<asp:Panel ID=pnlContainer runat=server></asp:Panel>
<asp:Button ID=btnSaveTextBox runat=server Text=Save OnClick="btnSaveTextBox_Click" />
</div>
</form>
</body>
I understand the problem is related to page life cycle, but am not being able to resolve it.
Could somebody please explain me the same OR write the "GetDynamicTextValue()" method for me.
Any help/referrence/discussion will be of real help. Am really stucked into an application that needs this utility.
Thanks a lot for reading.
</code>
|
|
|
|
|
Try the following code ~
ArrayList al = new ArrayList ();<br />
protected void Page_Load(object sender, EventArgs e)<br />
{ <br />
if ( !Page.IsPostBack )<br />
{<br />
Cache["myCtls"] = "";<br />
}<br />
else<br />
{<br />
if ( Cache["myCtls"].ToString() != "" )<br />
{<br />
try<br />
{<br />
al = (ArrayList)Cache["myCtls"]; <br />
foreach ( object o in al )<br />
{<br />
if ( o.GetType () == typeof (TextBox) )<br />
{<br />
TextBox txt = (TextBox)o;<br />
<br />
pnlContainer.Controls.Add (txt);<br />
}<br />
}<br />
}<br />
catch ( Exception ex )<br />
{<br />
Console.WriteLine ("Why?? Why? babe!" + ex.Message);<br />
}<br />
}<br />
}<br />
<br />
}<br />
protected void btnCreateTextBox_Click(object sender, EventArgs e)<br />
{<br />
TextBox txtDynamic = new TextBox ();<br />
txtDynamic.ID = "txtDynamic" + al.Count ;<br />
pnlContainer.Controls.Add (txtDynamic);<br />
al.Add(txtDynamic);<br />
Cache["myCtls"] = al;<br />
}<br />
protected void btnSaveTextBox_Click(object sender, EventArgs e)<br />
{<br />
Response.Write (GetDynamicTextValue ());<br />
}<br />
<br />
private string GetDynamicTextValue()<br />
{<br />
string str = string.Empty;<br />
foreach ( object o in al )<br />
{<br />
if ( o.GetType () == typeof (TextBox) )<br />
{<br />
str = str + ((TextBox)o).Text;<br />
}<br />
}<br />
return str;<br />
}
I have tested in my side and it works well...
Hope it helps.....
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
If you want to thank me for my help, please vote my message by clicking one of numbers beside "Rate this message". Why vote? Plz Read it here. Thank you.
|
|
|
|
|
Thanks a lot for the reply.
I understand what the code is doing is, its loading the textbox again in each page load so as to keep its existence thru the round trips. The solution is perfectly fine but i didnt wanted that to happen.
I dont want to reload the textbox once the "save" button is clicked.
To be pertinent, I want to know is there a way to "manuallly" catch the values stored in the PostBackData... i know abt _doPostback event, but then how to write a "generic" method which can keep track on the values of a desired control. [ ]
|
|
|
|
|
hi all,
I am developing a web application using asp.net 2.0 with VB.
I need to do Page output Caching for my page.
I am using both client and server controls in my page.
I need to cache the whole page for particular time period .
I have a HTML table in my page.I need to Cache the data in the HTML table also.
could anyone give me solution for this??
How can i Cache my whole page data including HTML table using the Page Output Caching Concept.
Thanks all in Advance.
Regards,
Senthilraj K
|
|
|
|
|
If you know exactly what to search for, why don't you? There are a lot of excellent tutorials and examples available already.
Search[^]
The answer to this kind of questions is better found in the material that is already available. If you have some more specific questions, those are better suited to be asked in a forum.
---
single minded; short sighted; long gone;
|
|
|
|
|
I have a website that is built in Front page, there over 50 pages, each built individually, so if I want to change the backl ground logo etc each page has to be changed, (huge task)
What I would like is a template for the front page that has the logo and contents list, background colour, and some code so that when it looks for another page the logo, contents and colour comes up automatically on that page.....
I am a novis when it comes to code, so was wondering if anyone could help..... I have googled for free templates and seen some that I like, but its the code bit I'm lost on
Regards
Duncan Halford
Website is www.ukcoldwar.org.uk
|
|
|
|
|
Have a look at master pages in the MSDN.
|
|
|
|
|
Hi
I have quiz project running online. and i am using sql server 2005 as backend. The controls i am using to show questions is detailsview. I need to show questions in random order. I don't know how to do it. If somebody knows pls tell me. I am in great trouble.
|
|
|
|
|
to select the records in random order, you can use "order by NewId()" in the select statement. something like this
select * from tblQuestions order by NewID()
bind the resultant set to the grid view
Regards John
|
|
|
|
|
Use , NewID()
Never Think That You Have Failed Instead Always Think That u hav Better Chance Next Time...
|
|
|
|
|
Another way to do that is to load the questions into a datatable. Create an integer array from 0 to datatable row count. Then use the Fisher-Yates algorithm to shuffle the array. Clone the original datatable and then load rows into the cloned datatable using the order of the shuffled array. Alternatively you could have a question order field in the question database and shuffle the numbers in the datatable. Finally bind the datatable to the detailsview grid. Cheers.
Mike Rehner
IT Teacher
Northeast Career Center
Columbus OH 43219
|
|
|
|
|
what will be the regex that doesn't allow < > tags?
regards
Dom
|
|
|
|
|
Your question is a bit vauge, so I don't know exactly what you want. Perhaps this:
The pattern "^[^<>]$" matches a string that doesn't contain either < or >.
---
single minded; short sighted; long gone;
|
|
|
|
|
Guffa wrote: "^[^<>]$"
This will match only one character, I think we need * to repeat the match.
|
|
|
|
|
|
i using crystal report in my project. i want to add page wise total for a column(stock) please give me a idea.....
|
|
|
|
|
This can be acheived by Implementing three different formula's in the crystal report.
--------------------------------------------------
Formula 1: -- create a shared variable and initialize it to 0
Shared numberVar pgTotal :=0 ;
Formula 2: -- create a shared variable with the same name to have the running total
Shared numberVar pgTotal := pgTotal + {Amount};
Note: Amount is the report field that total is to be calculated.
Formula 3: -- Create a shared variable with the same name and assign the same to have the page total
Shared numberVar pgTotal := pgTotal;
--------------------------------------------------------
after creating the formula's
1. place the formula1 field in the page header section of the crystal report
2. place the formula2 field in the detail section of the report
3. Supress the formula1 and formula2 field in the report
4. place the formula3 feild in the page footer to have the page total in each page.
Regards John
|
|
|
|
|
try this:
On the gridview theres a small arrow on the upper right, click that then choose edit columns. by that you can change column orders or do it on the Source.
|
|
|
|
|
Good Day!
I am using ASP.net 2005 (Visual Basic Code)
the table I bind with the gridview has too many fields, therefore, i want to display Other details of the gridview when mouseovered or when a expand button is clicked. i have googled this for about 1 week. unfortunately, Never found a article that could solve my problem.
Does anyone knows how to display extended details of a gridview? or does anyone know any working article?
|
|
|
|
|
cometburn007 wrote: Other details of the gridview when mouseovered or when a expand button is clicked.
This can be done using javascript and nesting grid view. You can put one more gridview for the extended details and find that on gridview on parent gridview's data binding event.
By default you can set the inner gridview's display style to none. When link is clicked, call a javascript function which makes this visible.
Hope this helps
|
|
|
|
|
Hi all,
I am trying to fill a GridView with data from a MySql Table.
The gridview is defined in the ASP-file. In the code behind the next code should fill the gridview with data via a Stored Procedure combined with an Array of Parameters.
Codebehind:
<br />
private void SetGridChooseServices()<br />
{<br />
<br />
MySqlParameter[] arrParameter0 = new MySqlParameter[0];<br />
String StoredProc = "GetServices";<br />
gridChooseServices = db.WerkGridViewBij(gridChooseServices, gridChooseServices.PageIndex, StoredProc, arrParameter0);<br />
PlaatsveldenInGridView();<br />
}<br />
Method WerkGridViewBij (means updateGridView):
<br />
public GridView WerkGridViewBij(GridView gv, Int32 paginaNummer, String DataSourceSelectCommand, MySqlParameter[] sqlParameters)<br />
{<br />
MySqlDataReader reader;<br />
<br />
try<br />
{<br />
MySqlCommand cmd = BaseDatabaseData(DataSourceSelectCommand, sqlParameters);<br />
cmd.Connection.Open();<br />
reader = cmd.ExecuteReader(CommandBehavior.CloseConnection);<br />
gv.DataSource = reader;<br />
if (paginaNummer > gv.PageCount) paginaNummer = 0;<br />
if (gv.AllowPaging)<br />
gv.PageIndex = paginaNummer;<br />
gv.DataBind();
reader.Close();<br />
}<br />
catch (Exception err)<br />
{<br />
gv.ToolTip = err.Message;<br />
}<br />
finally<br />
{<br />
if (gv.Rows.Count.Equals(0))<br />
gv.ToolTip = "Geen data gevonden!";<br />
}<br />
return gv;<br />
}<br />
Method BaseDatabaseData (used in WerkGridViewBij):
<br />
private static MySqlCommand BaseDatabaseData(String StoredProc, MySqlParameter[] arrParameters)<br />
{<br />
String connection = System.Configuration.ConfigurationManager.ConnectionStrings[1].ConnectionString;<br />
MySqlConnection con = new MySqlConnection(connection);<br />
<br />
MySqlCommand cmd = new MySqlCommand(StoredProc, con);<br />
cmd.CommandType = CommandType.StoredProcedure;<br />
cmd.Parameters.AddRange(arrParameters);<br />
<br />
if (cmd.Connection.State == ConnectionState.Open)<br />
cmd.Connection.Close();<br />
<br />
return cmd;<br />
}<br />
In the method WerkGridViewBij the result from the DB is no records strange enough, while in the database 14 rows are selected. Why do these rows not show up ?
-- modified at 5:12 Wednesday 22nd August, 2007
Error occurs when doing gv.DataBind();
The error says:
{"De gegevensbron biedt geen ondersteuning voor gegevenspaginering op de server."}
The DataSource does not support datapaging on the server.
|
|
|
|