Showing posts with label process. Show all posts
Showing posts with label process. Show all posts

Thursday, March 29, 2012

Pop Up Window Name - Would like it to be timestamp

Hi,

I'm an asp programmer currently in the low process of converting one of my asp intranets into asp.net (vb).

This is going to be one of many questions i ask on the forum (glad I've found it) !

I have a link a page that opens up popup window (removes all the buttons from the nav bar, chromless effect).

I would normally do the following at the top of the page:

<script language=javascript runat=server>
function GetTimeInMillisec()
{
var Now = new Date()
var TimeStamp = Now.getTime()

return TimeStamp
}
</script>
<%
varTimeStamp = GetTimeInMillisec()
%
Then the link would be:

<a href="http://links.10026.com/?link=javascript:launchwin('frameset.asp','<%=varTimeStamp%>','width='+(screen.width-11)+',height='+(screen.height-92)+',screenX=0,screenY=0,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,status=1,toolbar=0,top=0,left=0,resizable=yes')">Open</a
Can someone give me some pointers on how I am able pass a timestamp value (or another random character string) into the name of the window.

The reason I want this is in case a user wants to be able to have multiple instances of the system open.

Thank you
James Campbell

I take it you have a js function called launchwin? If so can you not set it there? If you want to use a .net datetime when the page was created use <%=DateTime.Now%>

There's few options depending on what your requirements are..


Hi,

Yes I have a js function called launchwin. Reading your post just makes me think that I am thinking too hard about a very simple problem !

Thanks for the nudge in the right direction.

James


To complete this thread I now have:

<a href="http://links.10026.com/?link=javascript:launchwin('System/Login.aspx','<%=DateTime.Now.toString("mmssffffff")%>','width='+(screen.width-11)+',height='+(screen.height-92)+',screenX=0,screenY=0,directories=0,fullscreen=0,location=0,menubar=0,scrollbars=1,status=1,toolbar=0,top=0,left=0,resizable=yes')">Launch</a
Thanks jibber !

James

Saturday, March 24, 2012

Populate DropDown with dataview

I have a bunch of dropdown on my form and I am trying to optimize the populating process. I am filling a dataview with a store proc and pass the dataview to each dropdown's datasource with a filter and sort expression. Until then every thing is fine however I need to add a black row at the top of each drop down and I dont know how to add it to my dataview or directly to dropdown. Any help would be great.

Here is what I got up to now


fctFillDropDownList(ddSource, 30, strSortAsc, dvTemp)
...

'*************************************************************************
'*************************************************************************
Private Sub fctFillDropDownList(ByRef objControl As System.Web.UI.WebControls.DropDownList, _
ByVal iParentID As Int16, ByVal strSort As String, ByRef dvTemp As DataView)
'*************************************************************************
dvTemp.RowFilter = "parentId=" & iParentID
dvTemp.Sort = strSort
objControl.DataSource = dvTemp
objControl.DataTextField = "Texte"
objControl.DataValueField = "Texte"
End Sub

After you call DataBind on the dropdownlist, you can do this (C# syntax):

MyDropDownList.Items.Insert(0, new ListItem("", ""));

That will add a blank row at the beginning of the dropdownlist.

HTH
Thanks that worked