|
Hi there,
I'm afraid not, your server-side code is in response to a request from the IFrame, thus the server has no knowledge of the outer frame - only the client does.
The only way you can do this is whatever action in the iframe HTML document that caused the request (e.g. form submission) was done via the outer frame. That is, the iframe document uses javascript to call the outer frame to initiate the request.
But in reality we are just moving the goal posts - bottom line is, to achieve what you want will require client-side scripting.
Perhaps what I should ask is why use an iframe? can you not achieve what you want to do with nested tables ??
Hope this helps,
Andy
|
|
|
|
|
Thank you for your reply,
Yes, I could use nested tables.
The reason I am using IFrame is to avoid sending same HTML code to the client multiple times as this tool will be used alot.
I need to check if the user is logged and if the user has permission to view each page. So I guess that I will have to use client-side script to redirect to the SignIn Page if the user isn't logged.
I have been writting ASP for 5 years and this is my first project on ASP.NET.
I am impressed by the ASP.NET architecture as it makes it so easy to build proper 3-Tier architecture applications.
So far all Administration pages I have done in Classic ASP, I have used the IFrame.
ASP.NET differs so much from classic ASP that I even thought that Microsoft might have provided some way to tackle such problems.
Thank you for your reply though.;P
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
Hiya,
Yeah I've done a couple of ASP.NET projects now and totally love it compared to the ASP projects I've done in the past.
The only issue I have with it is the event modelling creates far too much client-server traffic for my liking. In ASP I used to create an XMLHTTP component at the client-side and refresh parts of the screen using XML data and a server command page that accepted events (XML) and returned the results. It made for a nice, clean updating architecture.
Have you got round to reading the overview of ASP.NET 2.0 yet? At last, proper page templating + skinning , Client Callback Manager which reduces post-backs and Membership Service which maybe something of interest for you. All in all I can't wait for 2.0 - at last ASP will be the definitive development platform
Andy
|
|
|
|
|
Well, at work we installed the VS.NET Widbey beta on an old PC.
I saw that there are a lot of changes. The Master pages with placeholders etc...
Seems exciting. We shall see, in 2005 it will be released. Until then, happy programming with .NET 1.1 ;P
theJazzyBrain
Excellence is not an act, but a habit! Aristotle
|
|
|
|
|
Just 2 questions which I need to have answered plase.
1. Did you have a chance to think about my question of yesterday? Basically, there is an agency and agent table. There is a 1-to-many relationship between the agency and agent tables. One agency can have many agents, and each agent can belong to only one agency. Now, a principal (owner of the agency) can also be regarded as an agent, but can also have admin properties. The GUI for the normal agent and the principal will be different, because the principal can also add, delete, and modify properties, and can also have additional properties like add, delete or modify agent info. How do I specify permissions? I want use one login in screen, and from there it should be determined if it is a normal agent, or the principal that is logging in.
2. I came to you with this problem a while ago, and I don’t think you could help me back then. Maybe you know the answer now. How do you store login details in your db? I have a user table that contains a username and password. Only the password should be case-sensitive. For example, if the password is stored as myPassword in the db, then if the user types in MyPassword it should bring back no result. I can’t seem to figure out this case-sensitive issue with SQL server and Access. Both bring back a positive result and it doesn’t matter what case was used. I only want it to bring back a positive result if myPassword was entered.
Thanks guys!!!
|
|
|
|
|
Hi there,
Have a foreign key in the agent table that determines what type of agent they are, eg.
Table tblUserType
ID Desription
================================
0 default agent
50 principal
1000 superuser
and then in your agent table add an extra column that is a foreign key to the new tblUserType.
You could extend the tblUserType to have other columns that list the type of activities allowed - but in reality you'd normalize that to another table.
Also, probably worth creating a view that INNER JOINS with any other tables that holds information about a user, such that on your login screen you can quiz the view WHERE userid = < user id given > and get all the attributes you need.
As for case-sensitive - I'm afraid SQL and ACCESS are case insensitive. The only way round this is to generate a unique key when the password is created (and amended), e.g.
In the agent table, create another column that will hold the unique key as well as the password string
then, below is an example of how you would generate the unique key to use in this column
(Pseudo-code)
var strPassword = "myPassword";
var id = for(i=0;i < strPassword.length; i++) id += ascii(strPassword[i]);
...
...
insert row(strPassword, id)
Now you can search for it in SQL
SELECT UserId FROM tblUser WHERE password = 'myPassword' and id=1081;
The id 1081 comes from the ascii values:
m = ASCII 109
y = ASCII 121
P = ASCII 80
a = ASCII 97
s = ASCII 115
s = ASCII 115
w = ASCII 119
o = ASCII 111
r = ASCII 114
d = ASCII 100
=============
1081
=============
The id generated for "MyPassword" say, would be:
M = ASCII 77
y = ASCII 121
P = ASCII 80
a = ASCII 97
s = ASCII 115
s = ASCII 115
w = ASCII 119
o = ASCII 111
r = ASCII 114
d = ASCII 100
=============
1049
=============
You must remember though that if the user can change their password YOU MUST generate the new id too!
Hope this helps,
Andy
|
|
|
|
|
I AM TRYING TO CENTER A TABLE W/ A SCROLLER USING THE <DIV> TAG, AND THE TABLE IS NOT CENTERING. IVE TRIED DIFFERENT TYPES OF CENTERING, BUT NOTHING SEEMS TO WORK. THE TABLE ABOVE THE <DIV> TAG CENTERS, BUT THE ONE AFTER IT DOES NOT, IT STAYS OFF TO THE RIGHT. WHATS UP W/ MY CODE??? THANKS...
<table align=center class="tblHDR" width="650" cellpadding="0" cellspacing="0" border="1" bordercolor="steelblue" rules="none">
<tr bgcolor="steelblue">
<th width="10%" align="left">ID</th>
<th width="55%" align="left">File Name</th>
<th width="35%" align="left">Release Date</th>
</tr>
</table>
<div style="OVERFLOW: scroll; WIDTH: 650px; HEIGHT: 200px;" align="center">
<table align="center" DATASRC="#xmlUpdate" colspan= "2" class="tbl" width="650" cellpadding="0" cellspacing="0" border="1" bordercolor="steelblue" rules="none"
bgcolor="whitesmoke" style="CURSOR: hand" name="EntryTable" id="EntryTable"
onMouseover="changeto('lightsteelblue'); return true" onMouseout="changeback('whitesmoke'); return true">
<TR onclick="CurrentRecord(this.recordNumber)" >
<TD width="10%"><SPAN DATAFLD="UpdateFilesID"></SPAN></TD>
<TD width="55%"><SPAN DATAFLD="FileName"></SPAN></TD>
<TD width="35%"><SPAN DATAFLD="ReleaseDate"></SPAN></TD>
</TR>
</table>
</div>
|
|
|
|
|
I AM TRYING TO CENTER A TABLE W/ A SCROLLER USING THE TAG, AND THE TABLE IS NOT CENTERING. IVE TRIED DIFFERENT TYPES OF CENTERING, BUT NOTHING SEEMS TO WORK. THE TABLE ABOVE THE TAG CENTERS, BUT THE ONE AFTER IT DOES NOT, IT STAYS OFF TO THE RIGHT. WHATS UP W/ MY CODE??? THANKS...
|
|
|
|
|
In your table cells (td tags), change all the widths to 33% and add the align="center" attribute too them.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|
|
thanks for the response. i actually tried adding a <center> tag before and after the <div> tag and that worked. i dont know if thats the best approach, but it looks fine now, and everything is centered. thanks for you time.
woo doc
|
|
|
|
|
Hi folks,
I'm having a heck of a time trying to get this problem fixed. Here are the details.
We have a form that users enter date and time information into. The first field is receive date (mm/dd/yyyy and 2400 hour formats), the second field is the resolve date (mm/dd/yyyy and 24 hour format). What we do from here is compare them and get various information. Such as work time, total problem time, and stand by time. We also attempt to count each day as an 8 hour work day by getting rid of 16 hours per day.
I can get my math to work for a single month, but when the month changes (ie- 05/31/2004 for receive time and 06/01/2004 for resolve time) I get a negative value. Now the way my code is written, this is correct...the problem is that I need it to show as 8 hours TPT and not -520.
Any ideas how this might be corrected???
Here is the code:
<br />
function dateDiff(dateform) {<br />
date1 = new Date();<br />
date2 = new Date();<br />
date3 = new Date();<br />
date4 = new Date();
date5 = new Date();
fdayofour = 1072933200000;<br />
diff = new Date();<br />
<br />
if (isValidDate(dateform.ReceiveDate.value) && isValidTime(dateform.ReceiveTime.value)) {
date1temp = new Date(dateform.ReceiveDate.value + " " + dateform.ReceiveTime.value);<br />
date1.setTime(date1temp.getTime());<br />
}<br />
else return false;
<br />
if (isValidDate(dateform.ResolveDate.value) && isValidTime(dateform.ResolveTime.value)) {
date2temp = new Date(dateform.ResolveDate.value + " " + dateform.ResolveTime.value);<br />
date2.setTime(date2temp.getTime());<br />
}<br />
else return false;
<br />
if (isValidDate(dateform.CurrentDate.value) && isValidTime(dateform.CurrentTime.value)) {
date3temp = new Date(dateform.CurrentDate.value + " " + dateform.CurrentTime.value);<br />
date3.setTime(date3temp.getTime());<br />
}<br />
else return false;
<br />
if (date2temp < date1temp){<br />
alert("Date/Time Received cannot be greater than Date/Time Resolved");<br />
return false;<br />
} else if (date2temp>date3temp || date1temp>date3temp){<br />
alert("Date/Time Received/Resolved cannot be greater than the Current Date/Time");<br />
return false;<br />
} else;
<br />
date4temp = new Date(dateform.ReceiveDate.value);
date4.setTime(date4temp.getDate());<br />
<br />
rdate = date4temp.getDate();<br />
<br />
date5temp = new Date(dateform.ResolveDate.value);
date5.setTime(date5temp.getDate());<br />
<br />
rsdate = date5temp.getDate();<br />
<br />
<br />
<br />
rsall = (date2.getTime() - fdayofour);<br />
rall = (date1.getTime() - fdayofour);<br />
rdate = ((rsall - rall) / (1000 * 60 * 60));<br />
<br />
diff.setTime(date2.getTime() - date1.getTime());<br />
<br />
timediff = diff.getTime();<br />
dtimediff = diff.getTime();<br />
mtimediff = diff.getTime();<br />
<br />
days = (dtimediff / (1000 * 60 * 60 * 24));<br />
days = Math.floor(days);<br />
<br />
totdate = (rsdate - rdate);<br />
if (totdate >= 0){<br />
totdate = (totdate * 16);<br />
} else if (totdate < 0){<br />
totdate = (Math.round(days * 16))<br />
}<br />
mins = (mtimediff / (1000 * 60));<br />
hours = (mins / 60);<br />
hours = (hours - totdate);<br />
alert(rdate);<br />
worktime = Math.round((dateform.WorkTime.value * 10) /10);<br />
totalproblemtime = Math.round((hours * 10) /10);<br />
standbytime = totalproblemtime - worktime;<br />
standbytime = Math.round(standbytime *10)/10;<br />
dateform.WorkTime.value = worktime;<br />
dateform.StandByTime.value = standbytime;<br />
dateform.TotalProblemTime.value = totalproblemtime;<br />
return false;
}<br />
<br />
|
|
|
|
|
Hi there,
Are you using IE on a Win. platform? If so you could include a VBScript block in your client HTML page, and get the JScript to call a function in the VBScript block - give it the two dates and use the DateDiff function, e.g.
<script language='VBScript'>
<!--
Function GetDays(dtStart, dtEnd)
GetDays = DateDiff("d", dtStart, dtEnd)
End Function
</script>
<script language='JScript'>
<!--
function onClick()
{
var dtStart = new Date("2004/06/08");
var dtEnd = new Date("2004/07/09");
var nDays = GetDays(dtStart.getVarDate(), dtEnd.getVarDate());
alert(nDays);
}
</script>
Then you can treat each day as n x 8hrs or whatever is needed.
Hope this helps,
Andy
|
|
|
|
|
Thank you Andy....
I feel like an idiot atm, because we already have a VBscript for doing this, and I was trying to emulate it in javascript. We're using a SQL server to house a monstorus database, and this code I had typed in earlier is actually in a VB/ASP page.
I'll see if I can't modify the vbscript with the right tags and get it to work in the form.
Thanks for the input!
John
|
|
|
|
|
How about:
MillisecondsPerDay = 86400000;
function GetDays(startDate, endDate)
{
return Math.floor(
(endDate.valueOf() - startDate.valueOf())
/ MillisecondsPerDay);
}
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer
|
|
|
|
|
Hi,
I created a live chat application.Everything working fine in our devlompent server.But after we went live ,some messages are not reaching database server.For the chat window I used frame set having top frame for dispaly messages and bottom frame for sending messages.Can any one tell me why it's happening?why some meassages are not reaching database?
Thanks in advance
satya
|
|
|
|
|
Hi,
I created a live chat application.Everything working fine in our devlompent server.But after we went live ,some messages are not reaching database server.For the chat window I used frame set having top frame for dispaly messages and bottom frame for sending messages.Can any one tell me why it's happening?why some meassages are not reaching database?
Thanks in advance
satya
|
|
|
|
|
how can we stop multiple login of a user in a browser based application
|
|
|
|
|
you can store wheather this user is already logged or not in the Application object..
add the user name to the Application Contents Collection and remove it when he logges off.
|
|
|
|
|
What if they don't log off?
If the user closes his only browser window losing his link to the session. Then how are they going to get back into the system?
"No matter where you go, there your are." - Buckaroo Banzai
-pete
|
|
|
|
|
he'll have to wait till the previous session times out
|
|
|
|
|
Keep a database and check if the user is already logged in.
Any tool is only as good as you can use it!!
(http://www.pascalnet.tk)
|
|
|
|
|
Or you could use cookies. If users has a cookie, he is already logged in. so do not log him in again just continue with what content he was supposed to receive. Otherwise login the users.
This way even if the users closed the browser without loggin out he would still retain his login info till the cookie is valid
Any tool is only as good as you can use it!!
(http://www.pascalnet.tk)
|
|
|
|
|
how to code a treeview control for a web application
|
|
|
|
|
All I saw was how to ask the same question 3 times in a row.
BW
The Biggest Loser
"People look so snooty, take pills make them moody Automatic bazootie, zero to tutti frutti" -Hollywood Freaks
|
|
|
|
|
What do you mean "How to code"? Do you mean like how to use? Or how to create your own?
If you wan't to know how to use it... Search Google and CodeProject.
If you wan't to know how to create one, you would have to inherit from the Control, and draw it using GDI+.
Aaron Eldreth
TheCollective4.com
My Articles
While much is too strange to be believed,
Nothing is too strange to have happened.
- T. Hardy
|
|
|
|