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
A

Andrew Quinn AUS

@Andrew Quinn AUS
About
Posts
171
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Javascript RX URL
    A Andrew Quinn AUS

    Try this fairly crude pattern match...

    (\s|\n|^)(\w+://[^\s\n]+)

    For future reference, visit www.regexlib.com[^] to see if someone has already done the leg-work. You can also test them @ http://www.regexlib.com/RETester.aspx[^] Hope this helps, Andy

    Web Development javascript regex question

  • exprie a web page
    A Andrew Quinn AUS

    Hi, As well as the above solution, if you wanted the page to automatically navigate back to the logon screen (say if someone left the page open for too long), then insert the following meta tags in your HTML pages

    <html>
    ...
    ...

    ...

    This would navigate back to the login page after 10mins has elapsed. Hope this helps, Andy

    Web Development csharp asp-net question

  • Parent Window; Child Window Issue
    A Andrew Quinn AUS

    Hi, Are you not using the "Name" attribute of the window.open method? e.g. var wnd = window.open("http://www.google.com.au", "MYWINDOW", ... ); Even with a page refresh, when you perform this, IE will look for a window with the specified name and return the reference back to you. Of course, this means that you need to perform a navigate to do this, but it depends what you are displaying in your child window? Hope this helps, Andy

    ASP.NET help csharp javascript asp-net question

  • How to retrieve a value in [TEXTAREA] in an aspx page?
    A Andrew Quinn AUS

    Hi, You are missing the name attribute, e.g. <textarea id="TEXTAREAcoucou" name="TEXTAREAcoucou".... When you post a form off to the server, it is the name attribute that forms the key/value pair that you can access through Request.Form["TEXTAREAcoucou"].ToString() Hope this helps, Andy

    Web Development tutorial csharp html sysadmin help

  • Unsafe Code in a ASP project
    A Andrew Quinn AUS

    Hi, Have you tried different combinations, e.g. the switch also supports: -unsafe If this still doesn't work, you could always put the unsafe code in an assembly then include the switch when using the csc compiler. Hope this helps, Andy

    ASP.NET visual-studio csharp help tutorial

  • CSS Borders Always White???
    A Andrew Quinn AUS

    Hi, What browsers are you using to render the HTML? Also, are you setting the class at the table level or the cell level. I don't seem to have any problems using IE6. Can you post the HTML of the table + defined CSS that you are using. Cheers, Andy

    Web Development css wpf architecture help question

  • DHTML and MFC
    A Andrew Quinn AUS

    Hi, I would always use the wrappers as it will ease the time and readablity of your code. As an example, here is some code without the use of the wrappers:

    IUnknown* lpUnk = m_pSite->GetObjectUnknown();
    if ( lpUnk != NULL )
    {
    HRESULT hr;

    IHTMLDocument2\* pHTMLDocument2;
    hr = lpUnk->QueryInterface(IID\_IHTMLDocument2, (void \*\*)&pHTMLDocument2);
    if ( SUCCEEDED( hr ) )
    {
    	BSTR bstrColor = SysAllocString( buff );
    	VARIANT varColor;
    	varColor.vt = VT\_BSTR;
    	varColor.bstrVal = bstrColor;
    	hr = pHTMLDocument2-> put\_bgColor( varColor );
    	pHTMLDocument2->Release();
    }
    

    }

    and now the same code with the use of the wrappers:

    MSHTML::IHTMLDocument2Ptr spDoc(m_pSite->GetObjectUnknown());
    if (spDoc)
    {
    spDoc->bgColor = bstr_t("#ffffff");
    }

    As you can see it is substantially cleaner. And this was a simple example. You can also call any Javascript functions (from MFC) that are in the HTML page (I can show you how if you need to) And also, you can implement an event handler at the MFC side such that, for example, an onclick HTML event will cause the web browser control to call into your application. Hope this helps, Andy

    Web Development c++ html help question com

  • Read from HTML TextFiled (Client Side)
    A Andrew Quinn AUS

    Hi, Are you talking about from an <INPUT type='text'> to an asp:textbox ?? If so why not just make the <INPUT type='text'> a server control, e.g.

    <INPUT type='text' id='myTextbox' runat='server' name='myTextbox' value=''/>

    and then declare it at the server-side...

    protected System.Web.UI.HtmlControls.HtmlInputText myTextbox;
    ...
    ...
    ...
    ...

    Hope this helps, Andy

    ASP.NET html sysadmin tutorial question

  • DHTML and MFC
    A Andrew Quinn AUS

    Hi, Yes indeed IHTMLDocumentPtr is the starting point into the DOM. One thing that will help in the long run is to import the HTML type library - thus getting Visual Studio to generate wrappers around the numerous interfaces and methods. It wraps using smart pointers - so no QueryInterface/Releases to take care of. e.g. insert the following into either your header/implementation file

    #import "C:\Windows\system32\mshtml.tlb" no_auto_exclude

    This will generate two files, mshtml.tlh and mshtml.tli, in your project directory. The first is a header file, the next the implementation. With this done, here is a simple DHTML process from within MFC to get an element from the page...

    void CWebDlg::OnDocumentCompleteExplorer1(LPDISPATCH pDisp, VARIANT FAR* URL)
    {
    USES_CONVERSION;

    MSHTML::IHTMLDocument2Ptr spDoc(m\_ctlWeb1.GetDocument()); // This is the WebBrowser control
    if (spDoc)
    {
    	MSHTML::IHTMLDocument3Ptr spDoc3 = spDoc;
    	if (spDoc3)
    	{
    		MSHTML::IHTMLElementPtr spElem2 = spDoc3->getElementById(\_bstr\_t("idSpan1"));
    		if (spElem2)
    		{
    			CString strText = W2T(spElem2->innerText);
    			spElem2->innerText = \_bstr\_t("Hello There");
    		}
    	}
    
    }
    

    }

    See how we can easily get the different interfaces of the object. The wrapper is doing the QI under the covers when we do a simple assignment. Plus the smart pointer will release that reference once the object goes out of scope. You can also easily create elements at will, e.g. here we create a BGSOUND element and append it to the DOM document.

    MSHTML::IHTMLDocument2Ptr spDoc(m_ctlWeb1.GetDocument());
    if (spDoc)
    {
    MSHTML::IHTMLElementPtr spElem = spDoc->createElement(_T("BGSOUND"));
    if (spElem)
    {
    MSHTML::IHTMLBGsoundPtr spBG = spElem;
    if (spBG)
    {
    CString strURL = _T("http://xyzxyz/snd/newalert.wav");
    spBG->put_src((bstr_t)strURL);

    		MSHTML::IHTMLDOMNodePtr spBody = spDoc->body;
    		MSHTML::IHTMLDOMNodePtr spNode2Add = spBG;
    
    		// append new element to BODY
    		spBody->appendChild(spNode2Add);
    	}
    }
    

    }

    To answer your question about inserting an image - I not too sure, something at the back of my mind does ring a bell about embedding IMG data in an HTML page. I'll see if I can find out. But for now I would think about saving the image to the file-system and then referencing the IMG src tag to the location. If you have any questions about DHTML or using MFC to generate DHTML I'll be happy to answer them. Hope this help

    Web Development c++ html help question com

  • DHTML and MFC
    A Andrew Quinn AUS

    Hi, So are you saying that you want to Navigate() to your static HTML page (template) and then you want to start populating the contents of the page using MFC? Andy

    Web Development c++ html help question com

  • Is this possible ?
    A Andrew Quinn AUS

    Hi, You can create a frameset page in VS by: 1. In solution explorer, right-mouse "Add New Item..." 2. In the dialog, click "UI" in the left-hand treeview 3. Click on the "Frameset" in the right-hand listview 4. Choose whichever template suits your needs. This will create a HTML page with framesets embedded. If you wanted to make this an aspx page so that the server can control the contents, change the extension (in the Solution Explorer window) to xxxxx.aspx, Visual Studio will also inform you if you want to create the code-behind file too. Hope this helps, Andy

    ASP.NET csharp html asp-net question

  • Logon Failure?
    A Andrew Quinn AUS

    Just add the identity tag into your web.config file. the "..." is just to symbolise the rest of the contents of the web.config file. Now if your network isn't too heavily bolted down, you should be able to connect to the network resource. Of course if read access to the shared directory is guarded (i.e. "Everyone" doesn't have access) then you will need to do more configuring.

    ASP.NET question sysadmin help

  • Logon Failure?
    A Andrew Quinn AUS

    Hi Britnt7, Sorry I couldn't get back to you sooner. The problem is that your ASP.NET application is running in a process under the local machines IUSR_ account. This has limited access at best - but out on a corporate network is about as useful as the proverbial chocolate teapot. In *most* network setups I've encountered you can get access by just putting the following in your applications web.config

    <system.web>
    <identity impersonate="true"/>
    ...
    ...
    ...
    </system.web>

    This is fine in most intranets, but public-facing networks will be bolted down more-so and you will have to create a DOMAIN user account or group that the process will need to use. As this is an extremely verbose process to describe here and now, here is a link that will help you along... MSDN - Building Secure ASP.NET Applications: Authentication, Authorization, and Secure Communication Hope this helps, Andy

    ASP.NET question sysadmin help

  • Panel with Sroll
    A Andrew Quinn AUS

    Hi, Yes - rather than setting to "hidden", try setting it to "auto" As well as affecting the Y-axis, you can use overflow-x to change the horizontal behaviour. Or you can use overflow to change both horizontal and vertical. Here's the link to MSDN if you want more info. Hope this helps, Andy

    ASP.NET sysadmin

  • Web form text area
    A Andrew Quinn AUS

    Hi Rob, You can have some client-side script that does the following:

    var el = document.getElementById("TextBox1");
    if (el)
    {
    	el.focus();
    	el.innerText += "";
    }
    

    For your textarea this should place the caret at the end of the string in the control. You could run this in your onload event to automatically place it there everytime the page is (re)displayed. Hope this helps, Andy

    ASP.NET question csharp javascript sysadmin help

  • create hidden field with javascript and get its value in code behind on postback
    A Andrew Quinn AUS

    Hi there, From what I can see with the code you've posted, the problem is that you've created the hidden element but it's NOT a child of the FORM. Hence on post-back the values won't be posted and hence not picked up by the server-end. Adding the following to the document.createElement part of the code should fix it...

    NewHiddenControl = document.createElement("INPUT");
    // ...
    // ...
    var oForm = document.getElementById("Form1");
    if (oForm) oForm.appendChild(NewHiddenControl);
    

    Hope this helps, Andy

    ASP.NET javascript question

  • Panel with Sroll
    A Andrew Quinn AUS

    Hi there, You can use the overflow-y CSS property, e.g.

    Label l = new Label();
    l.Text = "This panel contains a label control which has a large amount of text. Text that does not fit will be clipped and hidden.";
    Panel1.Style\["overflow-y"\] = "hidden";
    Panel1.Controls.Add(l);
    

    Hope this helps, Andy

    ASP.NET sysadmin

  • Using C# and ASP .Net
    A Andrew Quinn AUS

    That would depend on what you were storing. Not wise if it was something like connection string information (although yes you could encrypt it) and then want about an object, you would have to implement serialize functionality to be able to restore the state of the object.

    ASP.NET csharp question

  • how to access server control from javascript
    A Andrew Quinn AUS

    Hi there, If you have a hidden textbox in a user control (say with an id of "Hidden1") and the id of the WebUserControl, when you insert it into the aspx page, is for example "WebUserControl11", e.g.

    <uc1:WebUserControl1 id="WebUserControl11" runat="server"></uc1:WebUserControl1>

    Then when the page is finally rendered, that hidden textbox will have an id of "WebUserControl11_Hidden1". So if in the aspx page you have some javascript, then something like the following will access it...

    function getHiddenTextValue()
    {
    strValue = "";
    var elHidden = document.getElementById("WebUserControl11_Hidden1");
    if (elHidden)
    {
    strValue = elHidden.value;
    }
    return strValue;
    }

    Hope this helps, Andy

    ASP.NET javascript sysadmin help tutorial

  • Moving from one page and back
    A Andrew Quinn AUS

    Something like this should do...

        Dim dirDate As Date
        Dim dirStrDate As String
    
        dirDate = Now()
        dirDate = dirDate.AddMonths(1)
    
        Do
            dirDate = dirDate.AddMonths(-1)
            dirStrDate = String.Format("C:\\{0}", dirDate.ToString("MMyy"))
        Loop Until System.IO.Directory.Exists(dirStrDate)
    

    dirStrDate will have the directory path of the first existing directory found. Remember though that if this code DOES NOT find any directory in the format you've mentioned IT WILL LOOP FOREVER - so either a change to the code is needed or make sure that a directory (e.g. C:\0101) exists as a fallback. Hope this helps, Andy

    ASP.NET csharp asp-net question learning
  • Login

  • Don't have an account? Register

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