|
Dear CPian,
in the HTML world, all tags have a STYLE called "position". The "position" style can have a few different values. The 3 most used that you should be aware of are:
inline
absolute
relative
The default one is INLINE which allows the HTML elements to be rendered as they are found within the HTML code. In other words they follow the flow of the code in respect of their parent element.
The ABSOLUTE positioning will ignore the hierarchy for of the element(in the HTML code) to wich is applied and position the element to exact coordinates having as origin the most top and most left of the browser wndow. This is why you will notice that all asolutely positioned elements also have a LEFT and a TOP style, style attributes that take as values numbers in pixels, picas, ems and percentages and a few others that my mind is missing now. So an element coded as such:
<DIV style="position:absolute; top:100px; left:100px;">I AM ABSOLUTELY POSITIONED</DIV>
will have its origin(top left corner of the DIV) to the coordinate 100,100 discarding any parent elements. No matter where it is found within the code, its position wouldn't change.
The RELATIVE positioning is the same with the ABSOLUTE with one main difference. It uses as an origin its parent elemets top most and left most position instead of the browser top most and left most position.
Hope I helped. :P
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
Hi all !
i want to access .ini files in clients local filesystem using client-side javascript.....
can i do that ?
do i have any control on client's local system ?
please reply back asap if u know anything related to that...
thank you,
abhi
Abhijeet Jadhav
|
|
|
|
|
|
Hi...
thanks for the information ...
actually i want to retrieve the version of ActiveX component registered on the client-side from client-side javascript code.
so i am instantiating component by calling
var obj = new ActiveXObject(name_of_component)
and then i invoke its method Get_Version() which returns me the version of component. In this Function, i can read .INI file to retrieve the version.
But the problem is that all methods of COM interface return HRESULT value, so to get version, i need to pass version parameter by address.
Now How do we pass function parameter by address in JavaScript ?
Can you help me doing that ? or any alternative way if you can think of.
Please let me know ASAP.
Thank You,
Abhi
Abhijeet Jadhav
|
|
|
|
|
Hi there
Is there a way to retrieve a remote servers SMTP logs in ASP.Net using vb code. I need the logs for reporting purposes, any help will be greatly appreciatted.
Thanks
|
|
|
|
|
|
how to draw a rectangle on an image in asp .net
|
|
|
|
|
You can't do it on the client end, you need to do it on the server, and then you do it the same as you would in a WinForms app - if you're sending an image to the client, you first load it into a Graphics object and draw on it.
If you just mean put a rectangle on the form in the browser, that's a whole different ball game. Remember, your C# code exists for the sole purpose of generating HTML, all you can show on the client is what you can show in HTML, and by using JScript if you must.
Perhaps SVG would help here ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi
i want to create a new folder in my site with programming
when an event fires.
how i can do it with c#?
thanks
|
|
|
|
|
using System.IO;
and in your event handler:
DirectoryInfo r = new DirectoryInfo("myRootPath");
r.CreateSubdirectory("MyFolder");
Of course, as you've asked in the web development area, you need to make sure that your web app has permission to create a folder at this location.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am developing a automated web data extraction program. One of the pages (POST) gets redirected. If I disable automatic redirection and attempt a GET to the redirection page, the server does not come back with the data (timeout). If I allow the redirection to occur, when I attempt to read the data (redirection is GET) I often end up reading a partial page (the transaction has not completed).
How can I tell the transaction completed for:
pFile = pServer->OpenRequest("POST", ....
:
pFile->SendRequest(NULL,NULL,(LPSTR)(LPCSTR)post_string,post_string.GetLength());
pFile->QueryInfoStatusCode(dwRet);
if (dwRet == HTTP_STATUS_OK) { <--- the status is OK even though the redirected read is in action at the time!
pFile->Read(htm_read_buffer, BUFFER_SIZE);
}
Thanks in advance!
|
|
|
|
|
Getting "the server returned an invalid or unrecognized response" error on the code listed below. The url is an asp page on my company's qa server that takes an
xml request, processes it and returns an xml response. The code works fine
at work when run from my win 2000 machine on our LAN but one of our clients
is complaining about the above error, he's using a win xp machine. I can reproduce the error if I take the code home and run it from my xp machine but I'm not a web developer so I haven't got a clue how to make it work. I searched msdn and found a few items regarding the above error, most of it I didn't understand but some of it suggested different IE security settings which I tried to no avail.
Any advice would be appreciated ...
var SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS = 2;<br />
var SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS = 13056;<br />
<br />
var url = "someurl.asp";<br />
var oXmlHttp = new ActiveXObject("Msxml2.ServerXMLHTTP.4.0");<br />
var domReq = new ActiveXObject("Msxml2.DOMDocument.4.0");<br />
<br />
domReq.async = false;<br />
domReq.loadXML(document.getElementById("req").value);<br />
<br />
oXmlHttp.open("POST", url);<br />
oXmlHttp.setOption(SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS,SXH_SERVER_CERT_IGNORE_ALL_SERVER_ERRORS);<br />
oXmlHttp.setTimeouts(30000, 30000, 30000, 90000);<br />
<br />
oXmlHttp.send(domReq);
<br />
Thanks
Andrew Bleich
|
|
|
|
|
I found a workaround...
I replaced Msxml2.ServerXMLHTTP.4.0 with Msxml2.XMLHTTP.4.0.
(and got rid of the calls to setOption() and setTimeouts because they
are not supported by Msxml2.XMLHTTP.4.0)
Thanks for all your help anyway,
Andy
Andrew Bleich
|
|
|
|
|
Hi,
If I am writing a toolbar application for IE using VS.NET, how do I debug my application?
If I set the Project properties' Start Application value to C:\Program Files\Internet Explorer\iexplore.exe, it is a release version and hence I can't debug.
How can I launch IE from my project and still debug it?
-Thanks in advance
Hari
|
|
|
|
|
hi,
what are the components of web services.
Satish.
|
|
|
|
|
On what end ? Perhaps if you clarify your question a little, a better answer can be provided. Do you want to write one, consume one, or just generally know about them ? Have you tried google ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hi Christian,
Actually this question was asked to me in an interview.He said their are four components and he claims that any one who does web services should know it.He just reveiled one that is SOAP and I am intreatsed to know about the other three and and want to learn about all the four components.
Satish.
|
|
|
|
|
Offhad, I guess if SOAP is one, he's talking about the different protocols involved. SOAP is XML over HTTP, basically. I reckon a google would give you more accurate technical terminology than I could offer.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm working on a very large website page that needs javascript functions to be added dynamically - otherwise the page size will become prohibitive. The functions are being added with the text of the selected topic on the website. Unfortunately, the functions aren't accessible, as far as I can tell.
I used the simple test of adding a function dynamically - the file below errors out with "Object Expected" when I click on the second <a> tag. I need the alertMe() function to be accessible. Ideas?
************ Start of File ************
<HTML>
<HEAD>
</HEAD>
<BODY>
<script>
function getTheDiv(){
theDiv.innerHTML = "<script>function alertMe(){alert('Success!');}</script>";
}
</SCRIPT>
<a onclick="getTheDiv();">Click to Generate alertMe() function</a>
<divid="theDiv"></div>
<a onclick="alertMe();">Click to Test alertMe() function</a>
</BODY>
</HTML>
************ End of File ************
|
|
|
|
|
I know this is only your sample code, but I see no ID or NAME tags or even a DIV tag. Make sure you have those all set.
Then you can use the document.getelementbyid method to get a reference to the div
var oDiv = document.getelementbyid("myDiv");
oDiv.innerHtml += "function alertMe(){alert('Success!');}";
|
|
|
|
|
Hi there,
I have a question with regards to SQL injection attacks. I have a section where a user can add data to a SQL Server database. I am using classic ASP with stored procedures. Basically the stored procedure looks something like.
CREATE Procedure sp_InsertTitle
(
@TitleName varchar(50)
)
AS
INSERT INTO tblTitle
(
TitleName
)
VALUES
(
@TitleName
)
GO
If a hacker tries to enter something into my textbox like:
' UNION SELECT name, type, id FROM sysobjects;--
I would like to know how to chek for this kind of data because if I enter this into the textbox it adds the complete string (' UNION SELECT name, type, id FROM sysobjects;--) to the database.
I would appreciate it if someone could help.
Thanks
Brendan
|
|
|
|
|
|
I have read that already, but it doesn't answer all my questions.
|
|
|
|
|
First, I should let you know that I never worked with Classic ASP and ADO, just the .NET variety, so if I make an incorrect assumption you can let me know.
If Classic ASP supports parameters on the command that it sends to the database then this will be okay because this separates the command from the data. So, if the data is dodgy it arrives at the stored procedure already wrapped as a parameter. If, however, the Stored Procedure is being called from ASP in the form EXEC sp_InsertTitle '[Value From Textbox goes here]' then you will have the potential for an attack to occur.
The part you should watch out for is the possibility of Second Order Injection Attacks. This means that the initial data is input into the data and it sits there quietly not doing anything. Then at some later point the column value is used to dynamically generate some SQL command. If you are doing that then there is a possibility of an attack at that point. This is actually harder to track down because the attack occurs but the payload does no damage until sometime later.
Does this help?
My: Blog | Photos | Next SQL Presentation
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
Hi there,
I am struggling with a piece ofcode. I am using using classic ASP (which is the normal ASP,and not ASP.NET). I am using SQL Server 2000 as the database. I am using stored procedures.
I am using the command object when adding data to the database. My code looks like this:
objCmd.Parameters.Append objCmd.CreateParameter("@ContactCommQues", adWChar,
adParamInput, 16, Request.Form("txtQuesComments"))
txtQuesComments is a input control. The value 16 in the CreateParameter method I took because when you define a field with the ntext datatype, it automatically inserts a 16 for the size of that field. OK, coming back to the CreateParameter method, the value 16 represents the size, and the MSDN library defines this field as "A Long value that specifies the
maximum length for the parameter value in characters or bytes". Now the problem is that I do not know what the length of the <textarea> will be, it might be a long letter or article, maybe it can be 10000 characters long. Do you know how I can solve this? What I thought wasmaybe I should replace value 16 with something like Len(Request.Form("txtQuesComments")). This seems to work, but is this the only way?
Here is a shortened version of my stored procedure:
CREATE Procedure sp_InsertContact
(
@ContactCommQues ntext
)
AS
INSERT INTO tblContact
(
ContactCommQues
)
VALUES
(
@ContactCommQues
)
GO
Thanks
|
|
|
|