|
OK. On some event (button click or textbox changed), set the DataTable.DefaultView.RowFilter = " Field like " + TextBox.Text
|
|
|
|
|
I'd really love to but I'm not using a DataTable
|
|
|
|
|
Hi,
Can anyone see the problem here? I have a very simple master page with a very simple content page. I just want a menu on the master page. There are several things that aren't working the way I would like them to.
1. The menu is horizontal and pushing the content place holder down when it's expanding down. I would like it to hover over the content page and not move it.
2. it's not displaying the items when hovering. It's just displaying a white box where the items are suppose to be.
I have been looking at this for 2 days without any progress. Can someone help me?
simple.master
***********************
<%@ Master Language="C#" AutoEventWireup="true" Codebehind="simple.master.cs" Inherits="EPMS.Frameset.simple" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Simple Master</title>
<style>
.toolbar
{
font-size: 13px;
font-family: Verdana;
padding: 6px;
filter:
progid:DXImageTransform.Microsoft.Gradient(gradientType=0,startColorStr=#ffffff,endColorStr=lightblue);
}
</style>
</head>
<body bgcolor="silver">
<form id="form1" runat="server">
<asp:SiteMapDataSource ID="ExampleSiteMapDS" runat="server" ShowStartingNode="false" />
<asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" CssClass="toolbar" DataSourceID="ExampleSiteMapDS">
<StaticMenuStyle CssClass="toolbar" />
<StaticMenuItemStyle CssClass="toolbar" />
<DynamicHoverStyle CssClass="toolbar" />
<DynamicMenuStyle CssClass="toolbar" />
</asp:Menu>
<br />
<br />
<asp:ContentPlaceHolder ID="middleContent" runat="server">
</asp:ContentPlaceHolder>
</form>
</body>
</html>
simplepage.aspx
********************************
<%@ Page Language="C#" MasterPageFile="~/Frameset/simple.Master" AutoEventWireup="true"
Codebehind="simplepage.aspx.cs" Inherits="EPMS.EPMS_Request.simplepage" Title="Simple Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="middleContent" runat="server">
<h2>
This is the simple page.
</h2>
</asp:Content>
web.sitemap
*******************************
<?xml version="1.0" encoding="utf-8" ?>
<siteMap>
<siteMapNode title="Home">
<siteMapNode title="Products">
<siteMapNode title="Hardware" url="Default.aspx?node=hardware">
<siteMapNode title="Mouse"/>
<siteMapNode title="Keyboard"/>
<siteMapNode title="NetCard"/>
<siteMapNode title="Monitor"/>
<siteMapNode title="PC"/>
</siteMapNode>
<siteMapNode title="Software" url="Default.aspx?node=software">
<siteMapNode title="Spreadsheet"/>
<siteMapNode title="Word Processor"/>
<siteMapNode title="Presentation"/>
<siteMapNode title="Mail"/>
<siteMapNode title="Games"/>
</siteMapNode>
<siteMapNode title="Books" url="Default.aspx?node=books">
<siteMapNode title="Programming"/>
<siteMapNode title="Debugging"/>
<siteMapNode title="Testing"/>
<siteMapNode title="Web Apps"/>
<siteMapNode title="WinForm Apps"/>
</siteMapNode>
</siteMapNode>
<siteMapNode title="Services">
<siteMapNode title="Consulting" url="Default.aspx?node=consulting">
<siteMapNode title="Processes"/>
<siteMapNode title="Management"/>
<siteMapNode title="Recruiting"/>
</siteMapNode>
<siteMapNode title="Development" url="Default.aspx?node=development">
<siteMapNode title="Web Apps"/>
<siteMapNode title="Enterprise Apps"/>
<siteMapNode title="Database"/>
</siteMapNode>
</siteMapNode>
<siteMapNode title="Support">
<siteMapNode title="Drivers" url="Default.aspx?node=drivers">
<siteMapNode title="Audio"/>
<siteMapNode title="Network"/>
<siteMapNode title="Printer"/>
<siteMapNode title="Modem"/>
</siteMapNode>
<siteMapNode title="Manuals" url="Default.aspx?node=manuals">
<siteMapNode title="Applications"/>
<siteMapNode title="Troubleshooting"/>
<siteMapNode title="Installation"/>
<siteMapNode title="Internet"/>
</siteMapNode>
<siteMapNode title="Updates" url="Default.aspx?node=updates">
<siteMapNode title="Release 1"/>
<siteMapNode title="Game Package"/>
</siteMapNode>
</siteMapNode>
</siteMapNode>
</siteMap>
Thanks, Jessica
|
|
|
|
|
The ASP.NET forum is more suitable for this kind of question.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Found it. In the epms web.config, there is a line
<system.web>
<xhtmlConformance mode="Legacy"/>
</system.web>
This was causing my problem.
http://weblogs.asp.net/dannychen/archive/2005/12/16/433332.aspx
(Sorry about posting in this forum. I was in the asp.net forum but when I clicked New Message, it created it in this forum.)
Thanks, Jessica
|
|
|
|
|
Hi,
I'm trying to make a project which "converts" for example from meters to centimeters. I fill 20 labels with a random generated question containing a "fromUnit" and "toUnit" object.
Here is my code:
public partial class Metrics : Form
{
private double[] _answer;
private TextBox[] _textBox;
private Label[] _labels;
public Metrics()
{
InitializeComponent();
this._answer = new double[20];
this._textBox = new TextBox[20];
this._labels = new Label[20];
this.label1.Text = this.getQuestion(1, 10);
}
private string[][] lengths = new string[][]
{
new string[] {"kilometer", "1000"},
new string[] {"hectometer", "100"},
new string[] {"decameter", "10"},
new string[] {"meter", "1"},
new string[] {"decimeter", ".1"},
new string[] {"centimeter", ".01"},
new string[] {"millimeter", ".001"}
};
public string[] getUnit(int index)
{
return lengths[index];
}
private string getQuestion(int minLength, int maxLength)
{
// Create Random object
Random rand = new Random((int)DateTime.Now.Ticks);
int length = rand.Next(minLength, maxLength); // Gets the length to convert
int randNumber1 = rand.Next(0, 6); // gets the first unit random number
int randNumber2 = rand.Next(0, 6); // gets the second unit random number
while (randNumber1 == randNumber2) // loop ensure that units are not the same
{
randNumber2 = rand.Next(0, 6);
}
string[] fromUnit = getUnit(randNumber1); // gets the unit details from class
string[] toUnit = getUnit(randNumber2); // gets the unit details from class
// gets the answer (i.e. (23 * .(01 / .001)) = 230)
this._answer = length * (Convert.ToDouble(fromUnit[1]) / (Convert.ToDouble(toUnit[1])));
//return the question string
return "How much is " + length.ToString() + " " + fromUnit[0] + "(s) in " + toUnit[0] + "(s)?";
}
private void btnCalculate_Click(object sender, EventArgs e)
{
}
private void FillLabelsWithQuestions()
{
foreach (Control label in this.Controls)
{
if (label is Label)
{
label.Text = getQuestion(1, 100);
}
}
}
}
The problem is, i don't know how to check if the answer is correct which is entered in a textbox and checks the answer when the button "calculate" is pressed, because there are strings involved too.
My labels are named like this:
label1
label2
label3
etc
And so are my textboxes:
textbox1
textbox2
.....
This is a screenshot of how my Form looks like:
http://i15.tinypic.com/49icglh.jpg
Anyone any suggestion?
Thanks in advance!
|
|
|
|
|
I wouldn't use a multidimensional string array. There are many other better options.
If you stay with the current array, you can store your answers in another array. Then check each answer against that array.
|
|
|
|
|
Hi edboe,
I ran out of options how to do it and the multidimensional seems to work.
Do you have a sample for me about that "check each answer against that array"?
Thanks in advance!
|
|
|
|
|
Hi...
How i can check Serailport status...? Means whether another application is using that serialport or not...?
In my application, if i dont check this & if some other application or hyprterminal is using same comport then my application is crashing...
Thanks in advance,
Vinay
|
|
|
|
|
<br />
SerialPort port = new SerialPort("COM1");<br />
<br />
try<br />
{<br />
port.Open();<br />
}<br />
catch(Exception ex)<br />
{<br />
MessageBox.Show("Port " + port.PortName + " is already in use")<br />
}<br />
~~~ From Milano to The Hague, easy as it goes ~~~
|
|
|
|
|
There is a requirement that, my application should sence that a pen drive is attached then it should read the files and copy to the machine.
What Should I do
My application is in C#
Please help
Rabindra
Rabindra
|
|
|
|
|
Can you be a bit more specific?
|
|
|
|
|
How to read an exact character from text file.
Example:line 2 char 15. Or just 15-th char.
I have Visual Studio 2003.
Vasildb
|
|
|
|
|
1 read the whole text in that file and put in a string.
2 split the string by "\n" and you will get array of strings
use it to get the line number.
3 when you extract the line go the your char
When you get mad...THINK twice that the only advice
Tamimi - Code
|
|
|
|
|
you can read in the textfile into a string and then select the character you want.
You could also read in the textfile line per line, put it in a string and select the character.
Look into StreamReader class and string class on MSDN.
hope this helps.
V.
Stop smoking so you can: enjoy longer the money you save.
|
|
|
|
|
There are some set of server controls its property enabled= may be true or false,now in code behind how to find its current state and i am getting the controls id during runtime like this
foreach(Control c in form1.Controls)
{
............
}
Thanks In Advance
Thanks In Advance
|
|
|
|
|
foreach(Control c in form1.Controls)
{
if(c.Enabled)
MessageBox.Show("this control is enabled");
else
MessageBox.Show("this control is not enabled");
}
|
|
|
|
|
but there is no property enabled availble there....
Thanks In Advance
|
|
|
|
|
What stancrm has written is correct.
You can use the 'Enabled' property of System.Windows.Forms.Control
There are two types of fools in this world: One who give advice and the others who do not take it...
|
|
|
|
|
Hi, Dear Respected Programmers
Kindly convert the mentioned VB6 method into C# language.
strActual = "BAT BALL GOALKEEPER"
intPosition = INSTR(strActual,"BALL"
Thank you in Advance
|
|
|
|
|
string strActual = "BAT BALL GOALKEEPER";<br />
int intPosition = strActual.IndexOf("BALL");
|
|
|
|
|
Thank you very much... now it is working
|
|
|
|
|
Let's first convert it to VB.NET:
strActual = "BAT BALL GOALKEEPER"<br />
intPosition = strActual.IndexOf("BALL")
Now it's very simple to convert it to C#:
strActual = "BAT BALL GOALKEEPER";<br />
intPosition = strActual.IndexOf("BALL");
Note: There is a difference how strings are handled in .NET compared to VB6. The index is zero based, not one based, and IndexOf it returns -1 if the string is not found, not 0.
---
b { font-weight: normal; }
|
|
|
|
|
|
Wrox is best
Syed Shahid Hussain
|
|
|
|