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

Kasic Slobodan

@Kasic Slobodan
About
Posts
127
Topics
47
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • the last song
    K Kasic Slobodan

    That would definitely be, Iron Maiden - The Clairvoyant

    The Lounge question

  • How to open 17012 port on Windows 2008 Server?
    K Kasic Slobodan

    I am having a trouble opening port 17012 on Windows 2008 Server. I need to allow incoming traffic and I have added exception in Windows firewall for both UDP and TCP, but port remain time outed. I have also visited Windows Firewall with Advanced Security and tried to open it, but still no luck. I also Googled for the answer, but nothing works. No extra firewalls no AV's except Windows Defender... Does anyone know the solution for this?

    System Admin sysadmin security tutorial question

  • RenderContents - Adding items after rendering...
    K Kasic Slobodan

    First of all, I want to apologize for stupid title. Don't have any idea how to form it well. Second, I have to work on custom data grid for project. Stored procedure sometimes return one table, and sometime more then one. I've started the project, but I faced the problem on the beginning. I want to be able to add items to that grid like you can add items to ListView in windows forms which will give me more control. (Without Java Script, only ASP.NET) On RenderContents I have a code that render table header and footer so that table can be displayed in DesignMode (WebControl). I've also created a void that takes one argument. String (which is the actual data to be added) and then generate tr's and td's and save them in some variable. That variable is appended in RenderContents void (between header and footer part), but when I run it, table gets rendered, but the generated data is rendered outside the table. The question is, can I achieve this kind of functionality and how?

    ASP.NET question csharp java css asp-net

  • Anoying add-in, context menu, problem...
    K Kasic Slobodan

    I am developing a add-in and I've planned to write an article about it, but I am facing VERY annoying problem that I can't figure out. I've loaded up virtual machine to test a real time behavior of the add-in and notice this problem. When I am run add-in (F5) from it's project, context menu items adds to the menu of the code window and aspx context CommandBars. After I build a setup (containing .dll, .addin file and adding proper value in registry) and opening a project, add-ins main window loads, but context menus don't. I have two folders in the installation folder. One is for VS 2005 and other for VS 2008. First time, I was testing with only one folder (for VS 2005) and context menu items was working. Further on, I've added second folder to the setup project, build it and send to to virtual machine for testing. Context menus didn't show up. Ever since then I was unable to get them work. I also though that setup is building with wrong .dll, but I am pretty sure that's not the case. To exclude that possibility, I've manually added .dll file to the install folder. Add-ins main window works on both Visual Studios. Please help! This is driving me crazy!!! And sorry if I was confusing...

    C# help visual-studio windows-admin testing beta-testing

  • CollectionBase trouble...
    K Kasic Slobodan

    Your article helped. Thank you.

    ASP.NET css design help tutorial

  • CollectionBase trouble...
    K Kasic Slobodan

    I've downloaded some sample project and I found that contains code of how to implement adding items from design mode (CollectionBase). I've started to implement that into my test project I was working on and created a property like.

    public MenuItemCollection MenuItems
    {
    get { return items; }
    }

    When I go to design mode and add user control, in property grid, of that user control, I have MenuItems, but it doesn't open a dialog letting me to add the items. It acts like a string :confused:. To check whether I am crazy or not, I've added bool property to see will this work fine and display as a dropdown with true and false. That did worked, so now I am puzzled. I've searched on the net with no luck. I don't see any differences between that sample project and mine except that I use UserControl (partial class), but then again, why shouldn't properties work with partial classes as well (they worked with bool property) so now I am asking you for help. Thanks.

    ASP.NET css design help tutorial

  • Session state created while response flushed....
    K Kasic Slobodan

    Session state has created a session id, but cannot save it because the response was already flushed by the application.

    I have a big problem with this error. Few days ago, web app worked fine and when session expired and I refreshed the page, code inside Session_Start in global.asax logs me in again.

                cookie = Request.Cookies\["Userword"\];
                
                if (cookie != null)
                {
                    string strCookie = cookie.Value;
    
                    if (strCookie != "")
                    {
                        sin.AutoLogin(cookie.Values\["heavy"\],
                            cookie.Values\["metal"\],
                            true, Request.UrlReferrer.AbsoluteUri == null ? "" : Request.UrlReferrer.AbsoluteUri, false);
    
                    }
                }
                else
                {
                    if (Session\["UserInfo"\] == null)
                    {
                        Response.Redirect("login.aspx");
                    }
                }
    

    Yesterday I can't login by refreshing the page, any more. If I login manually, everything is ok. Error raises only when session expires and user refreshes the page. When I try to step in AutoLogin function, try catch block catches the Object reference error before debugger was able to step into a function. The above error I caught in Application_Error in global.asax. I have searched the net for solution, but with no luck. Most of the answers were that you shouldn't use Response.Flush and I have Response.Flush only in captcha class which is loaded on login.aspx page and everything worked great until yesterday. Can anyone help me with this issue?

    ASP.NET help debugging question

  • StatusCode not working properly.
    K Kasic Slobodan

    I did take a look, but this post is written today :). I was few days ago on your blog :). Anyway, thank you for your help.

    ASP.NET help sysadmin debugging tutorial question

  • StatusCode not working properly.
    K Kasic Slobodan

    Thank for your reply, but could you give me any example how can I do this? I don't quite understand how can I simulate 500 internal server error with HttpHandler? On the other hand, I do use HttpHandler for captcha. Sorry for late reply. I had some issues with logging on Code Project.

    ASP.NET help sysadmin debugging tutorial question

  • StatusCode not working properly.
    K Kasic Slobodan

    Me again. I have a strange problem with StatusCode. I want to simulate a '500 Internal Server Error' by setting Response.StatusCode equal to 500, but it doesn't seem to work. I've turned on trace, page renders properly, but the Status code in trace is 500. I even turned on custom errors in web.config, but Response.Status = 500 doesn't make ASP to redirect to a page inside web.config, but when I misspelled a URL, ASP redirects me to a 404 error page. Can anyone tell me how to simulate page status like that error really happened? Thank you so much!

    ASP.NET help sysadmin debugging tutorial question

  • Storing class into session
    K Kasic Slobodan

    Yes. I was doing outside the events. Thank you for your reply and your time. If I asked later, I would save some time figuring out what went wrong :). And thank you Navaneeth for a tip about casting. Best regards and thanks both of you.

    ASP.NET help database design question

  • Storing class into session
    K Kasic Slobodan

    I changed a way of storing user information from many session to one session object with storing a class into that session. I have a class like:

    public class UserInfo
    {
        // Inside this class there are properties to store users data (all properties are public)
        string _username;
        int _id;
        bool _somePermission;
    
        ...
        and so on
    }
    

    When user logs in and if user have all necessary permissions, I create a new instance of a UserInfo class

    UserInfo user = new UserInfo();
    

    And then read user permissions, from database, for every page on a site and store it in each property that correspond to

    user.Username = dataReader["username"];
    user.ID = dataReader["id"];
    user.SomePermission = dataReader["some_permission"];
    

    And finally, store that class into session like

    Session.Add("UserInfo", user);
    

    On every page, where I need information from session, I do

    UserInfo user = (UserInfo)Session["UserInfo"];
    

    And then use

    user.Username, user.ID or user.SomePermission
    

    But, theres something wrong about it. When I try to compile it, I get an error (marking Session)

    An object reference is required for the nonstatic field, method, or property 'System.Web.UI.Page.Session.get'

    I am missing something, thats for sure, but I don't know what. Anyone would help me with this? Thanks in advanced.

    ASP.NET help database design question

  • Object reference not set and session issue...
    K Kasic Slobodan

    I've added check if connection is opened, but unfortunately, I have to wait to see if error comes again :), but I definitely have to change some things in my code. Your session property sounds great. I have to implement that. Thank you Christian and best regards.

    ASP.NET help tutorial question

  • Object reference not set and session issue...
    K Kasic Slobodan

    I am sorry for stupid title, but I don't know how to name the thread. Anyway, I am working on a web admin panel and I have a problem about object reference. I know what this error mean, but what I don't know is why I reload some page 1000 times and I try to reload it 1001 time, and I get object reference? Sometimes is on if (dataReader.Read()) and sometimes on if ((bool)Session["SomeText"]). Can session be abandoned this way? Before this if's, I have another if (in session_start in global.asax) that verifies whether session is null or not. Does anyone have an idea what could be a problem?

    ASP.NET help tutorial question

  • Why CodeProject keeps logs me off from time to time?
    K Kasic Slobodan

    Thanks. Helped me too.

    IT & Infrastructure question discussion lounge

  • Why CodeProject keeps logs me off from time to time?
    K Kasic Slobodan

    Few days ago, I've noticed that I am not logged in and I login (I never sign out). Time passes and here I come to CP again, status - logged off. Now I was watching new articles and noticed that I am logged off, so I login, load another article and puff, logged off again. Logged back again in order to write this post and I was logged off when I click on General Discussion forum. What's happening? Or my firefox is on drugs :)?

    IT & Infrastructure question discussion lounge

  • We're 8!
    K Kasic Slobodan

    Happy birthday Code Project. I wish you all the best, and keep up the good work in the future to come ;).

    The Lounge c++ php com sysadmin linux

  • Strange comma in Request.Form
    K Kasic Slobodan

    I didn't knew that and yes, your right. There are two controls with same name, I just checked. Thank you for solving the mystery ;).

    Clever Code javascript docker help question

  • Strange comma in Request.Form
    K Kasic Slobodan

    I have JS function that displays the div container with appropriate userControl for manipulating users permitions. JS funtion:

    function ConvertProfessional(id)
    {
    document.getElementById("userId").value = id;
    document.getElementById("adminPermition").style.display = '';
    document.getElementById("adminEdit").style.display = 'none';
    }

    It's a table with a bunch of the check boxes and a hidden field where would be stored user id for that particular user. When I click on a link, JS function gets called and displays the div and sets the user id in the hidden field. Hidden field:

    <input id="userId" type="hidden" name="userId" />

    Then I click on a submit button and with Request.Form["userId"] get that user id. The problem i on the picture. http://img132.imageshack.us/img132/9104/reqds0.jpg[^] Somehow, out of nowhere, comma appears :omg::wtf: I put alert(id) in the JS function and it displays proper value. I also checked with firebug when the page is rendered, and still proper value. This is how I get the value of hidden field and any other control as well. Nothing gremlin in here :).

    string uid = Request.Form["userId"];

    I don't know what is going on, but since everything is going on, I workaround a problem with this:

    uid = uid.Remove(uid.IndexOf(','));

    Pretty comfortable :-D.

    Clever Code javascript docker help question

  • Event not firing
    K Kasic Slobodan

    Debugger says that, when I click on submit button, Page.IsPostBack is false?! Hows that possible? I even add a new button, and tried with it and same thing.

    ASP.NET question sysadmin help
  • Login

  • Don't have an account? Register

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