|
I have added CSS for my project and deployed it on testserver.but the changes is not reflected on test server but it is working on my local machine
|
|
|
|
|
Did you clear your web browser cache and try out?
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
The woods are lovely, dark and deep,
But I have promises to keep,
And miles to go before I sleep,
And miles to go before I sleep!
|
|
|
|
|
i wrote the coding like this how get the same space between the all line any one help me this coding get error message
Dim x As Int64
Dim DetailsS As String = Nothing
Dim strcolname As String = Nothing
Dim Isbn As String = Nothing
For x = 0 To DataGridView1.RowCount - 1
strcolname = DataGridView1.Rows(x).Cells(2).Value.ToString
Isbn = DataGridView1.Rows(x).Cells(10).Value.ToString
Dim strpad As New String(" "c, 13 - Len(strcolname))
DetailsS += strcolname + ":" + strpad + Isbn + vbCrLf
Next
TextBox1.Text = DetailsS
modified on Tuesday, February 10, 2009 3:06 AM
|
|
|
|
|
What error message, what line?
It wouldn't happen to be Dim strpad As New String(" "c, 13 - Len(strcolname)) would it?
|
|
|
|
|
First: What Is a User-Control Embedded Class?
A User-Control Embedded Class is a user-control with no U.I. but has a separate class (such as public class MyEmbeddedClass() { }) located just below the user-control's partial class, and the class is just like any other class, having properties, private and static methods (mostly static), etc., such that when the user-control is placed on a web page, only that webpage wherein the user-control is placed on can now call MyEmbeddedClass() methods.
And, in a web app that compiles on the fly, only that web page is impacted when MyEmbeddedClass (located in the user-class'es code-behind) is changed.
Usage:
Create a user control called classMyStuffcontrol.ascx, then add a SEPARATE class to it as follows
public class MyStuff(){
}
We'll pretend it is a decent sized class, having 12 or so static methods (functions), around 500 lines of code.
Focus #1: Now, this user control is needed on about 7 web pages and 3 other user controls.
1) Does this mean, in Focus #1, that there would be 10 instances of the class Mystuff (within classMyStuffcontrol.ascx), even though there are only static methods?
Focus #2: Now, one of those pages which already uses one of the user controls that has MyStuff() in use also needs access to the class MyStuff, so I add the MyStuffControl to the web page as well..
2) Does this mean that there are multiple instances of the class MyStuff for that webpage and user-control, both using classMyStuffcontrol.ascx, would there be 2 instances of the class MyStuff instantiated even though there are only static methods?
Now, before ya start asking "why", here's why I do this:
- some 3 years ago I was asked to create a single user control that did tons of stuff; no extra code files would be accepted. So I coded the whole thing in a single UI page and corresponding code-behind page (those 2 files were acceptable). The code behind had 6 separate classes which focused on a given set of tasks.
Soon after this, a different client asked for the same thing once they became aware that I had done something like this already. From there, it kept snowballing; client after client wanted similar output (1 or 2 files containing all the code for a big solution.
After 6 months, I set aside this 'practice', but a few months later started using it wherein only a single class was associated to a single user-control. Now, there are still the universal / web-app-wide classes I used, but alot of the other classes were specific to a given area, and/or not used as much as a webapp-wide class would be used.
What this permitted was my ability to change the user-control embedded class, affecting only those web pages (wherein an on-the-fly compile took care of it) versus a web-app restart (such as what occurs when the web.config file is changed).
Have I described this enough such that you would be able to provide feedback as to its usefulness and/or practicality? Specifically, am I asking for trouble down the line or are user-control embedded classes, when used in moderation, a reasonable solution?
Thx.
ASP ~ Apple Simply Performs
|
|
|
|
|
While I can't say that I fully understand what you are trying to accomplish, it sounds like your trying to separate concerns. You want your UI markup to be separate from the code that controls it. If that is the case, and you are trying to separate concerns, I highly recommend you look into the MVP and MVC patterns. Both are designed to achieve a separation of concerns, separating UI from the code that controls it, allowing the two to be developed independently. In addition, its possible to use a single presenter or controller (logic) with multiple views (ui).
|
|
|
|
|
I use .Net's on the fly compile in for web-apps. I'm seeking to reducing the number of web-app restarts.
If I have a general ClassName.cs file in the web-app App_Code folder and I change code in that file, the whole web-app will restart, and this causes current web sessions to become invalid.
Keep in mind that this general ClassName.cs file has code that is only used on specific pages, not throughout the whole web-app.
So, I take that class and put it into the code-behind of a user-control; I call this a User Control Embedded Class, or UCEC. When I update code in the embedded class, only those pages to which the User Control has been added are recompiled on the fly versus the whole web-app, which results in a web-app restart / lost sessions.
I do understand what MVC and MVP provide, and even in those patterns I use UCECs.
ASPX ~ Apple Simply Performs eXcellently
|
|
|
|
|
How can I tell my program to run under every system-setting with the NumberFormat of "en-US"?
I used this for a part of my project, but I am sure there is a way to tell the program once the "right" format and to use it then by default in the whole program.
Globalization::CultureInfo^ culture = gcnew Globalization::CultureInfo( "en-US",false );
Globalization::NumberFormatInfo^ format = culture->NumberFormat;
double value = Double::Parse(stringValue, format);
|
|
|
|
|
You can set the culture on the current thread:
Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US", false);
|
|
|
|
|
Thank you!
That's exactly what I was looking for.
|
|
|
|
|
I made class called LinqFilter
public class LinqFilter<t>
{
.......
}</t>
and I made a user control
public class lablab : usercontrol
{
linqFilter<[here i want to not put exact class but i want to still make it generic] > koko;
}
and i want to specifiy the [T] at runtime can I Do that
OR
can I Get the T from Parameter come from outside the usercontrol
I tryid this code but i get an error
public class lablab<z> : usercontrol
{
linqFilter<z> koko;
}
thanks a lot
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
modified on Monday, February 9, 2009 12:25 AM
|
|
|
|
|
You can't. Generics are (IIRC) really just syntaxic sugar that tells the compiler to write code for each Type you specify in the Generic. Say you pass two different types of objects to a Generic method. The compiler automatically writes two methods, using your code as a template, to handle both cases of those objects passed to it. Types used by Generics are determined at compile-time, not run-time.
|
|
|
|
|
Generic reference types are more than syntactic sugar; the compiler only has to produce one JIT-compiled instance of a method that uses a generic reference type, but the method can produce objects which are 'ready to go' in the desired type without the expense of a typecast or other run-time validation. I know of no way such a result could be achieved without generics.
There are limits to what generics can do, but they seem to be a very useful feature with significant semantic meaning. Extension methods, by contrast, seem more like syntactic sugar.
|
|
|
|
|
thanks a lot for your replay and explanation
but could you tell me how can I use the second choice
I mean how to make the user control accept T as Template
something like this :
public class kokoControl<t> : UserControl
{
.....
}
</t>
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
What are you ultimately trying to do with this??
|
|
|
|
|
ok I'm sorry my replay was not complete .
i will tell you the full story
I made generic class that can make DynamicLinq For any class
this class is
public class LinqFilter<T>
{
some of :
public Fun<T,bool> GetFilter()
{
Expression Filter ;
Filter = Expression.And(.....)
..............................
var predicate = Expression.Lambda. .... .
return (Func<T,bool> )predicate.Compile();
}
}
the previous class work well I want to use it inside
a user control called FilterControl
but I want to make the control also as a Generic Class
just to pass the T inside the control
public Class FilterControl<T> : UserControl
{
LinqFilter<T> F;
................
}
but I got an error when tried to do that
how can I pass the T from outside the control to the
[F] Variable of linqfilter .
thanks
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
So I fired up Snippet Compiler[^], added System.Core.dll as a reference, and wrote this little snippet of code:
public class Base<t>
{
public Func<t,> GetFilter()
{
return delegate(T t) { return true; };
}
}
public class BaseCotnrol<t> : UserControl
{
Base<t> foo;
}</t></t></t>
It compiled just fine. Could you post the compiler error?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
first , thanks a lot for your replay
I thought that I will not get the answer !!
I will try that but could you explain more what should this code do ?
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
My code doesn't really do anything. &l;smile /> I just wrote some code that looked like your code to make sure that it compiles.
It compiled.
Unfortunately, that just means that I don't understand the nature of your question. Can you post something more indicative of your plight?
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
I will explain
I made this class
public class LinqFilter<T>
{
public Fun<T,bool> GetFilter()
{
var predicate = Expression.Lambda. .... .
return (Func<T,bool> )predicate.Compile();
}
}
there is a user control called FilterControl
I need to use object of previous class [LinqFilter]
inside this control but I want to get The [T]
Type from out side the user control
the following code make compiler error
when i put <T> in User Control definition
public Class FilterControl<font color="red"><T></font> : UserControl
{
LinqFilter<T> F;
................
}
I hope to not give me joking code again
thanks
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
When you write that you "want to get the [T] Type from out side the user control", what do you mean by that? Do you mean that you want to bind T at runtime rather than at compile time? Something like the following pseudocode?
t <- assign some resolved Type
create an instance of FilterControl<t> dynamically and bind t to T
put the instance of FilterControl`1 on your form</t>
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|
|
What I need is :
When I put the FilterControl in the window , I want to specify the T Type
I mean in Compile Time in this way the control will be able to
make filtering on objects of any T class with support from LinqFilter class
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
Ah ha! Now I understand. The Visual Studio designers do not support controls with unbound generic parameters. You can't create your FilterControl<T> : UserControl and then use the forms designer to drag it onto a panel or form.
You might be able to adapt a TypeDescriptor for the user control for your forms, though I've never seen this done. There's an article on Urban Potato that does this for controls with abstract base classes: Using Visual Studio Whidbey to Design Abstract Forms[^].
|
|
|
|
|
thanks a lot I will read this article ( in sha'a allah)
and I hope to find what I want
Thanks very match
You have To Search About The Truth Of Your Life
Why Are you Here In Life ?
|
|
|
|
|
If you find or develop something interesting, then don't forget to come back and post a solution so that we all can learn!
"we must lose precision to make significant statements about complex systems."
-deKorvin on uncertainty
|
|
|
|