|
A more appropriate solution would be to not return the unwanted values from the database in the place.
How are you populating the arraylist? You could filter the contents as they are being added by using the Contains method, or filter the dataset.
only two letters away from being an asset
|
|
|
|
|
Hello, I'm looking for a way to detect from where the surfer is from.
I know google has such a thing and they can tell me from what country, region and even city I live in.
I know that in C# it something with colture.
How can I do it in ASP.NET?
|
|
|
|
|
We're writing a ASP.NET 2.0 (using C#) app, and in this app, we have several forms. On one of the forms, we're seeing some truly strange behavior.
When you repeatedly enter text into an edit field (in ur case an asp:TextBox) on a form, a history list gets created. Each subsequent time you begin to enter text into the edit field, this history list is displayed so you can pick a previous entry. So far, so good, right?
Our problem is that the history list is displayed about 100 pixels LOWER than where it should be (and it's always offset by the same amount). The vertical offset does not appear to be governed by the height of the table (or cells in the table), and it happens for ALL edit fields on the form. This behaviour has not been observed on any other foms on the same web site. The general format of the page follows:
div
/div
div
form
table
tr
td
asp:TextBox...
/asp:TextBox
/td
/tr
tr
td
asp:TextBox...
/asp:TextBox
/td
/tr
/table
asp:GridView
/asp:GridView
/form
/div
Does anyone have any idea as to what we may have done to cause this offset?
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
By history list do you mean the AutoComplete displayed by IE? Is FireFox working alright?
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
Yeah, the little history list thingy that drops down when you type the first letter.
Firefox chokes and pukes on the whole site in spectactular fashion. Since the site is on a "secure" intranet, and users aren't allowed to install software, it's guaranteed that everyone will be using IE...
BTW, when the history list is displayed, it's always the same vertical distance from the edit control you type in.
-- modified at 12:08 Wednesday 23rd August, 2006
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
My current guess is that it has something to do with the CSS styles esp. the positioning. If you have the Web Developer toolbar you can try disabling the CSS and see if you have the same problem. If you are using inline styles try disabling that and see if that works out.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
I googled a different way and found something interesting.
We're using IFRAME to contain our content pages, and I added the following style to the IFRAME tag in default.aspx:
style="position:relative; left:0px; top:0px;"
It brought the history list now exhibits a different offset characteristic - it's now just a few pixels higher than the bottom of the associated edit field, and a couple of pixels to the left. Once again, this behavior is only seen on this one page on the site. All of the others are okay.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Please don't say IFRAME when you ask us 2.0 gurus a question.
What I like to do is put everything inside html tables. Learn them, they are your friend.
Here is an example of a well designed master page. Theming is enabled on the page. In App_Themese\Main\Default.css I have the following.
Table
{
font-family:Arial, Verdana;
font-size:9pt;
white-space:normal;
width:100%;
vertical-align:top;
}
.EmptyRow
{
height:10px;
}
.EmptyRowSmall
{
height:2px;
}
Notice "white-space:normal" it prevents a lot of headaches. Any css class that doesn't have a "." in front of it is automatically applied. Hence the following style will be applied to all tables. Make sure you put EnableTheming ="True" in the page directive and supply Theme="Main" in content page.
Below you will see a well organized master page.
<code>
<form id="form1" runat="server">
<div>
<table>
<tr>
<td style="width:15%;">
</td>
<td style="width:85%;">
<asp:Label ID="lblHeading" runat="server" CssClass="Heading">Brokerage Rates Maintenance</asp:Label>
</td>
</tr>
<tr class="EmptyRow">
<td style="width:15%;">
</td>
<td style="width:85%;">
</td>
</tr>
<tr>
<td style="width:15%; vertical-align:top;">
PUT MENU HERE.
</td>
<td style="width:85%; vertical-align:top;">
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</td>
</tr>
</table>
</div>
</form>
</code>
I hope this is useful to you.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
px?RateFactorID=4" Text="Loss Ratio" Value="4">
</asp:TreeNode>
<asp:TreeNode NavigateUrl="~/DebitCredit/Main.aspx?RateFactorID=5" Text="Protection Class"
Value="5"></asp:TreeNode>
<asp:TreeNode NavigateUrl="~/DebitCredit/Main.aspx?RateFactorID=6" Text="Valuation"
Value="6"></asp:TreeNode>
<asp:TreeNode NavigateUrl="~/DebitCredit/Main.aspx?RateFactorID=7" Text="State Multiplier"
Value="7"></asp:TreeNode>
<asp:TreeNode NavigateUrl="~/DebitCredit/Main.aspx?RateFactorID=8" Text="Theft" Value="8">
</asp:TreeNode>
<asp:TreeNode NavigateUrl="~/DebitCredit/Main.aspx?RateFactorID=9" Text="Windstorm / Hail"
Value="9"></asp:TreeNode>
<asp:TreeNode NavigateUrl="~/DebitCredit/Main.aspx?RateFactorID=10" Text="Coinsurance"
Value="10"></asp:TreeNode>
<asp:TreeNode NavigateUrl="~/DebitCredit/Main.aspx?RateFactorID=11" Text="Deductible Rate Factor"
Value="11"></asp:TreeNode>
</asp:TreeNode>
<asp:TreeNode SelectAction="Expand" Text="Mono Line Property" Value="0">
<asp:TreeNode NavigateUrl="~/MonoLineProperty/BaseRates.aspx" Text="Base Rates" Value="Base Rates"></asp:TreeNode>
<asp:TreeNode NavigateUrl="~/MonoLineProperty/MaxLimits.aspx" Text="Max Limits" Value="Max Limits">
</asp:TreeNode>
<asp:TreeNode NavigateUrl="~/MonoLineProperty/MinimunDeductibles.aspx" Text="Minimum Deductibles"
Value="Minimum Deductibles"></asp:TreeNode>
</asp:TreeNode>
</Nodes>
<NodeStyle Font-Names="Verdana" Font-Size="8pt" ForeColor="Black" HorizontalPadding="0px"
NodeSpacing="0px" VerticalPadding="0px" />
</asp:TreeView>
</td>
<td style="width:85%; vertical-align:top;">
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server">
</asp:contentplaceholder>
</td>
</tr>
</table>
</div>
</form>
</code>
I hope this is useful to you.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Ummm...
1) I didn't design this app, I'm just fixing niggly little problems in it.
2) It's a little late for a rewrite at this point. We're releasing the first beta this friday, and that means no structural changes unless it's a show-stopper.
I did find this though. It turns out to be a bug in IE6 regarding IFRAMES and forms...
MSDN Q920681[^]
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I'm sorry your just fixing it and it has Iframes in it. Bummer. Iframes are buggy and there is always a better way. Good luck.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
I asked the guy that implemented the iframes why he did it, and he said it was so that he could dynamically change the content like you can in a normal frameset.
All that's left to say about that is "alrightie then".
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
ToddHileHoffer wrote: Please don't say IFRAME when you ask us 2.0 gurus a question.
What I like to do is put everything inside html tables. Learn them, they are your friend.
You're kidding me, right? I mean, <iframe> may not be the right tool for the job here...but <table> based layout is the trademark of a crappy web developer who thinks it's still 1995 and has no clue what a style sheet is. If you're putting everything in <table>s, you're really not allowed to claim that you're a guru.
225 years ago, we set an example for the rest of the world by creating a country where everyone could vote... Well, except for women and black people, but we fixed that! -Adam Duritz, of Counting Crows
|
|
|
|
|
David Stone wrote: but based layout is the trademark of a crappy web developer who thinks it's still 1995 and has no clue what a style sheet is.
Hmmmm, I must be a crappy web developer...
Table-based layouts are perfectly fine. Rigidly using of CSS is fairly impractical, and I refuse to sit there for hours on end trying to figure out what CSS elements are compatible in which browsers and to what extent. I simply don't have the time. My own personal website is a table-based layout because - well - it works in all the browsers, and it requires less work to produce.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
You do realize as long as you respond to the cross posting crap, people will continue to do it? So, you're part of the problem here, not the solution.
Jeremy Falcon
The mind is like a parachute. It works best when it is open. - Colin Angus Mackay (2006-08-18)
|
|
|
|
|
I did not intend to originally, but the problem was interesting so I decided to respond.
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
It's not impossible to figure it out on your own and keep it to yourself. You just caved in man, admit it.
Jeremy Falcon
The mind is like a parachute. It works best when it is open. - Colin Angus Mackay (2006-08-18)
|
|
|
|
|
And you do realize that when you cross post here with lounge commentary your validating it or are being hypocritical. Two wrongs man...
Why are you posting to this thread instead of emailing Rama with your detective work?
This statement is false.
|
|
|
|
|
|
You do realize as long as you respond to the cross posting crap, people will continue to do it? So, you're part of the problem here, not the solution.
Jeremy Falcon
The mind is like a parachute. It works best when it is open. - Colin Angus Mackay (2006-08-18)
|
|
|
|
|
Terribly sorry you are in a bad mood. Did you get out of bed the wrong side today ?
modified 1-Aug-19 21:02pm.
|
|
|
|
|
And copy-paste posting is soooo much better.
225 years ago, we set an example for the rest of the world by creating a country where everyone could vote... Well, except for women and black people, but we fixed that! -Adam Duritz, of Counting Crows
|
|
|
|
|
I got help anyway, so neener-f*ckin-neener.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Neat they say you learn somthing everyday. Well today is the first day that I have learned anything in a while.
how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things
--thedailywtf 3/21/06
|
|
|
|
|
Those links weren't the right ones, but I eventually did find the answer in a MSDN article.
MSDN Q920681[^]
-- modified at 16:47 Wednesday 23rd August, 2006
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Hello folks!
I´ve implemented some custom error handling that writes the error to a log file then redirects the user to my custom error page. The strange thing is: this all works fine when i run the project in VS2005 using f5 but when i just choose to directly go to any page causing an error (like 'view in browser') error logging still works ok but my custom error page is ignored. Instead the regular asp.net error page is used.
It´s done like this...
First the web.config:
<httpModules>
<add type="Munkeby.Web.ErrorHandlingModule, CaseComponents" name="ErrorHandler" />
</httpModules>
My httpModule:
public class ErrorHandlingModule : IHttpModule
{
private HttpApplication application;
void IHttpModule.Init(HttpApplication app)
{
this.application = app;
this.application.Error += new EventHandler(ErrorHandler);
}
private void ErrorHandler(Object sender, EventArgs e)
{
Exception ex = application.Server.GetLastError();
string errorString = "\n\n" + DateTime.Now.ToString() + " " + ex.Message + "\nInnerException: " + ex.InnerException;
TextWriter tw = File.AppendText(application.Server.MapPath("errorLog.txt"));
tw.WriteLine(errorString);
tw.Close();
application.Server.Execute("Error.aspx");
application.Server.ClearError();
}
#region IHttpModule Members
public void Dispose()
{
}
#endregion
}
And, finally the error page:
protected void Page_Load(object sender, EventArgs e)
{
Exception ex = Server.GetLastError();
if (ex != null)
lblErrorMessage.Text = ex.Message + "<br /><br />" + ex.InnerException;
}
Hope it makes sense.
/J
|
|
|
|