Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

krisp

@krisp
About
Posts
49
Topics
25
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • VSTO (Save as Version Word 2000)
    K krisp

    Hello, On my web server I have Word 2003, and I would like to dynamically generate a Word doc and save it to the server, and return a link to the client so he/she can download it. However, my cient only has Word 2000, but VSTO requires Word 2003. Once I generate the Word 2003 doc, can I save it as a Word 2000 version, so that older versions of Word on my clients can read it? Thanks in advance for any feedback, advice and/or help you can give. Cheers, Kris.

    .NET (Core and Framework) sysadmin beta-testing help question announcement

  • (DR["Name"] is DBNull) vs (DR["Name"] == DBNull.Value)
    K krisp

    (DR["Name"] is DBNull) vs (DR["Name"] == DBNull.Value) I am curious as to which has better performance? Thanks.

    C# visual-studio performance question

  • Disabled controls don't maintain state
    K krisp

    I have some radio buttons, I set them to disabled in codebehind, this way the user has only a readonly version of the page controls. However when the page postsback they loose their state. No radio buttons are checked. Usually if the control is enabled upon postback then: Page.Request.Form["myRadioButton2"] == "on" And the ASP .Net engine/parser sets myRadioButton2.Checked = true; However, this Name/Value pair is not in the Page.Request.Form Name/Value collection whenever the control is posted back in a disabled state. I even save its state in SaveViewState() and load it in LoadViewState(); it loads the correct values at first, but then when OnLoad is reached, the ASP .Net engine/parser has sets its state back to the default (Checked = false). Any help on this would be much appreciated. I have this probelm occurring in many areas with many other controls. Always when controls are disabled. CheckBoxLists loose state, DropDownLists loose state as well. Thanks!

    ASP.NET csharp help announcement

  • CompareValidator
    K krisp

    The compare validator for type="Currency", does not allow () for a negative amount. Does anyone know a way around this? 45.00 // allowed -45.00 // allowed (45.00) // not allowed I really need to allow () for a negative amount. Thanks anyone who can help.

    ASP.NET help question

  • create hidden field with javascript and get its value in code behind on postback
    K krisp

    Hey, thank a lot Andy. Works flawlessly now. Perfect, thanks again.

    ASP.NET javascript question

  • create hidden field with javascript and get its value in code behind on postback
    K krisp

    I dont want to have to register a hidden field in code behind, i want to dynamically create the hidden field in javascript and then it should appear in the Request.Form if i had created it in javascript. But it is never there in code behind (IsPostBack == true). It use to work, and now it doesn't. Anyone see why or what im missing? //javascript HiddenValue("CurrencyID__VALUE", "CAD"); // called from other function function HiddenValue(id, value) { var NewHiddenControl = document.getElementById(id); if (NewHiddenControl == null) { NewHiddenControl = document.createElement("INPUT"); NewHiddenControl.type = "HIDDEN"; NewHiddenControl.id = id; NewHiddenControl.name = id; } if (value != null) NewHiddenControl.value = value; return NewHiddenControl.value; } // code behind if (IsPostBack && Request.Form["CurrencyID__VALUE"] != null && Request.Form["CurrencyID__VALUE"].Length > 0) CurrencyID.SetValue(Request.Form["CurrencyID__VALUE"]); Thanks.

    ASP.NET javascript question

  • resize iframe to size of contents
    K krisp

    I would like to resize an iframe to the offsetWidth and offsetHeight of the contents in the iframe. However, It requires me to set a timeout so that the offset sizes can be determined. If I dont set a timeout, it seems that IE has not fully deteremined the offset sizes and therefore the iframe gets sized to be too small. Especially when there are images in the contents of the iframe. But if I wait one second, IE has by then rendered everything and it knows the actual offset sizes of the contents of the iframe. This seems like a horrible way to achieve this functionality. Is there any javascript event that fires once the actual layout has been determined? function ResizePage(WaitASec) { if (window.frameElement) { if (WaitASec) { window.setTimeout("ResizePage(false);", 1000); return; } window.frameElement.style.height = document.getElementsByTagName('div')[0].offsetHeight; window.frameElement.style.width = document.getElementsByTagName('div')[0].offsetWidth; } }

    Web Development javascript question

  • ListItem Attributes not rendering
    K krisp

    I add attributes to my list items in a CheckBoxList. I would assume that the attributes would be rendered into the of each item. But the attributes are not rendered anywhere. I tried adding the attributes to the item before I added the item to the CheckBoxList. I tried adding the attributes in OnPreRender() by iterating through all the items in the CheckBoxList. I tried inheriting from ListItem so I could render them myself, but the class is Sealed. Thanks for any help anyone can give.

    ASP.NET help

  • XML comments don't show up when referencing DLL
    K krisp

    If i create a library, and comment all public and protected members. With the XML comments in C#. Then the comments nicely pop up when im coding in other classes, or projects within the same solution that holds the project with the commented class. But, when I now take the DLL, and reference not by project (not adding the project to my new solution), but by file reference, like how you would any third-party dll, the comments don't show up. How do I tell the compiler to compile the xml comments into the dll. Or what do I have to do? Thanks, Kris.

    C# question csharp xml

  • override OnLoad or handle Load event
    K krisp

    Hi all, Curious why by default Visual Studio makes you handle the Load event, when you derive a class. Usually in a derived class I would think you would: protected override void OnLoad( EventArgs e ) { // my code base.OnLoad(e); // this will raise the Load event. // my code, is this the better spot, let the base do its load first? } but it seems that Visual Studio always adds an event handler to the Load event in your class for you to implement your own OnLoad code, why? OnInit(){ Load += new EventHandler( Page_Load ); } With windows forms, the documentation says that overriding OnFoo is the preferred way for inheritors. So why not for asp.net web controls, why the event handler instead? Is there much difference? Thanks for your opinions/help.

    ASP.NET csharp asp-net visual-studio winforms help

  • Select MID?? instead of TOP
    K krisp

    but i have no idea what value1 and value2 would be. Maybe I have an auto-increment PK but that won't work because if some rows get deleted, then you dont have a range of 10 records knowing that a multiple of 10 records was skipped. This wont work. I modified my question, see the bottom of the original question, i added an example i found. Thanks anyways.

    Database database asp-net com question

  • Select MID?? instead of TOP
    K krisp

    Is there a way instead of using SELECT TOP 10 to say something like: SELECT MID 11 10 or something, so it starts at the 11th record and takes 10 records after it. This way I can easily put my data into pages, straight from the database, with 10 records on each page. I would also need to be able to first order them and then take 10 records starting from some nth record. Any suggestions, returning 2000 records when i only display 10 seems very wastefull. Thanks. http://www.codeproject.com/aspnet/custompaging.asp I found this link here, but this seems very inefficient as well. It creates a temp table and still selects all records and inserts them into the temp table. Regarding this way... does the # in front of the table name mean it gets dropped when the stored procedure is done running? The Author never drops it, and so if multiple people called this function at the same time, what happens to the temp table? Never seen the pound sign # in front of a table before. Thanks some more.

    Database database asp-net com question

  • Listing the tables of MS Access (Error is This)
    K krisp

    try: Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};User Id=Admin;Password= or maybe with double quotes on the password, but i dont think you need them, just let it end at the = Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};User Id=Admin;Password="" or with all default options: Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};User Id=Admin;Password="";Mode=Share Deny None;Extended Properties="";Jet OLEDB:System database="";Jet OLEDB:Registry Path="";Jet OLEDB:Database Password="";Jet OLEDB:Engine Type=5;Jet OLEDB:Database Locking Mode=1;Jet OLEDB:Global Partial Bulk Ops=2;Jet OLEDB:Global Bulk Transactions=1;Jet OLEDB:New Database Password="";Jet OLEDB:Create System Database=False;Jet OLEDB:Encrypt Database=False;Jet OLEDB:Don't Copy Locale on Compact=False;Jet OLEDB:Compact Without Replica Repair=False;Jet OLEDB:SFP=False

    C# help

  • Explicit abstract methods.
    K krisp

    Ok, well this is pretty much exactly what i want to do with an abstract method. public class DataBase { ... } public class BaseClass { protected abstract DataBase DoMethod(); } public class DataChild : DataBase { ... } public class ChildClass : BaseClass { private int _MyInt = 6; protected override DataBase BaseClass.DoMethod() { return DoMethod(); } public DataChild DoMethod() { return new DataChild(); } } I am returning an object in my child's method that derives from the object being returned in my base's method. So, this would not have any problems that I can see. I don't see how this has anything to do with multiple inheritance, because I would still only be inheriting from one class. There is no reason why the return value can't be derived from the abstract method's return type. I can not see in any way this conflicting with any multiple inheritance, or anything. That way when the object is casted to its base class, the proper return type is still received. What am I missing for this not to work?

    C# help question

  • While we're on the subject of language constructs
    K krisp

    The only way I can see is: public interface IMyNotificationsControl { ... } public void MyFunction(IMyNotificationsControl control) { if( ! ( control is System.Windows.Forms.Control ) ) { throw new Exception( "Must be of type System.Windows.Forms.Control" ); } ... } or public void MyFunction(System.Windows.Forms.Control control) { if( ! ( control is IMyNotificationsControl ) ) { throw new Exception( "Must implement IMyNotificationsControl" ); } ... } sorry, i dont think there is any other way.

    C# csharp oop help tutorial question

  • Explicit abstract methods.
    K krisp

    I was getting at the fact that you can do this with interfaces, so why not abstract classes? Seems like it should be logical, an abstract class is just like a regular class with the abstract methods comming from an interface, except it has the abstract keyword. public interface BaseInterface { string MyMethod(); } public class ChildClass : BaseInterface { private int _MyInt = 6; string BaseInterface.MyMethod() { return MyMethod().ToString(); // this calls int MyMethod() } public int MyMethod() { return _MyInt; } }

    C# help question

  • Explicit abstract methods.
    K krisp

    Just wondering, Why, in a child class, can you not set an abstract method you override, to call a different method that returns something else, but has the same signature. And declare the abstract method by Explicit means. I know it is a compile error, but is it not something they could have easily allowed, or are there behind the scenes issues im not understanding? You can do this with interfaces, so why not abstract methods? public class BaseClass { protected abstract string MyMethod(); } public class ChildClass : BaseClass { private int _MyInt = 6; protected override string BaseClass.MyMethod() { return _MyInt.ToString(); } public int MyMethod() { return _MyInt; } }

    C# help question

  • CheckedChanged Event not firing
    K krisp

    Hi there, In ASP.Net, my checkbox is not firing its checkedchanged event when its the first postback of the page, and the checkbox was initially checked. If the checkbox was unchecked initially, it works everytime, but if it wasn't checked initially then it does not work the first time you uncheck it, then after you uncheck it and then when you check it again, it fires. It always posts back everytime, and __EVENTTARGET is always the checkbox's name. InitializeControls adds the event handler everytime, for both page_load and checkedchanged, even on the first postback when you uncheck the checkbox, it adds the handler but it does not get called. Page_Load always gets called. Anyone have any, off the top of their heads, ideas of what would cause it to ignore the checkedchanged event? Thanks for any suggestions of where I could start.

    ASP.NET csharp asp-net question

  • String Array written to and parsed from hidden web control
    K krisp

    Wow, thanks alot Heath. You have always been the one to asnwer all my questions, and your always right :) Well, thanks again.

    C# javascript html data-structures xml json

  • Custom WebControl - Rendering Images
    K krisp

    What I had done is: set the "img source" to myPic.aspx then in myPic.aspx.cs in the Page_Load event, write to the output stream: "MIME=image/jpeg" // or something like that and then just write your image you draw to the stream as well. Bitmap bm; // draw to it bm.Save( Response ); // the response stream this works, i have done it before, but this is not exactly correct, can't remeber the exact words/code not sure of the correct form for MIME type, but look on google for MIME types or something. You can even pass parameters to yout myPic.aspx?lines=1,2,8,9 which could draw a line from 1,2 to 8,9 Or save the bmp in the Session and retreive it from the sesion when the client requests myPic.aspx, but i have not tried this session idea before. Hope that might help.

    C# html question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups