|
Yes, you are right
But how can I catch the error so I can inform the user that the browser needs to be refresh. I will inform the user thru the msgbox.
hifiger2004
|
|
|
|
|
That is the wrong thing to do. Asking the user to refresh doesn't mean their next request will go to the correct web server that has their session info. They might just get the same error over and over. I think you should really look at setting up a session server so that your session state will work on your web farm / cluster.
Ben
|
|
|
|
|
Honestly I haven't tried yet if how it will be done using the session server and on how to setup he session server.
I think it will take me long enough before the session server will be created, isn't it?
But for now, I think I will have to catch the error first, but the problem is I don't have an idea on how to catch it.
Maybe that's the next thing that I must do, the session server. And maybe I will search for some steps on how to do it, later.
hifiger2004
|
|
|
|
|
I have never set up a state server for the session state, but I don't think it is that hard. Still it is the right thing to do. Here is the Microsoft help on State server. It gives you all the details you need to set it up.
StateServer mode stores session state in a process, referred to as the ASP.NET state service, that is separate from the ASP.NET worker process or IIS application pool. Using this mode ensures that session state is preserved if the Web application is restarted and also makes session state available to multiple Web servers in a Web farm.
To use StateServer mode, you must first be sure the ASP.NET state service is running on the server used for the session store. The ASP.NET state service is installed as a service when ASP.NET and the .NET Framework are installed. The ASP.Net state service is installed at the following location:
systemroot\Microsoft.NET\Framework\versionNumber\aspnet_state.exe
To configure an ASP.NET application to use StateServer mode, in the application's Web.config file do the following:
Set the mode attribute of the sessionState element to StateServer.
Set the stateConnectionString attribute to tcpip=serverName:42424.
Note
To improve the security of your application when using StateServer mode, it is recommended that you protect your stateConnectionString value by encrypting the sessionState section of your configuration file. For details, see Encrypting Configuration Information Using Protected Configuration.
The following example shows a configuration setting for StateServer mode where session state is stored on a remote computer named SampleStateServer:
Copy Code
<configuration>
<system.web>
<sessionstate mode="StateServer"
="" stateconnectionstring="tcpip=SampleStateServer:42424" cookieless="false" timeout="20">
Note
Objects stored in session state must be serializable if the mode is set to StateServer. For information on serializable objects, see the SerializableAttribute class.
To use StateServer mode in a Web farm, you must have the same encryption keys specified in the machineKey element of your Web configuration for all applications that are part of the Web farm. For information on how to create machine keys, see article 313091, "How to create keys by using Visual Basic .NET for use in Forms authentication," in the Microsoft Knowledge Base at http://support.microsoft.com.
Hope that helps.
Ben
|
|
|
|
|
Ok I will try it
And one more thing, aside from modifying something into the web.config, do I need to modify something also in my session variables to all the aspx pages that has a session variables? Or I will just leave it as is?
Thank you Ben
hifiger2004
|
|
|
|
|
You just need to make sure that all the config files on the web farm have the same value. As long as the session state service is running everything should just work. So you don't need to change the way you are using the session variable and your errors should go away.
Ben
|
|
|
|
|
Thanks Ben
hifiger2004
|
|
|
|
|
Or is there a way to handle the error so I can change the error message?
hifiger2004
|
|
|
|
|
Hi!
plese help me create a master page and also customize my website on sharepoint server 2007
|
|
|
|
|
There are many tutorials online for doing this, which I would recommend reading. If you get any specific questions then I would recommend posting them here.
As a pointer I would recommend looking into MS Sharepoint Designer 2007 which is a great piece of software for UI configuration in Sharepoint.
|
|
|
|
|
I'm looking for an example of how to do the following if it is possible.
I have a table in ASP.net, inside the table are text boxes. I want to take a numeric value from these text boxes and add them up, without posting the page back to the server, and display the total in a label in a different cell.
I'm not sure where to start, so I'm looking for ideas.
Thanks,
Bradley
|
|
|
|
|
Bhicken78 wrote: without posting the page back to the server
Client side operations are mostly done using scripting with javascript. Browser compatibility can be an issue. Check out places like WebMonkey.com and www.w3schools.com
There are ??? how many places with javascript related material ... a lot.... really really a lot.
|
|
|
|
|
Hi,
This is code I used to work with 1 textbox value passed and a label that must change.
Hope this help.
if (!IsPostBack)
{
string script = ""+
"function calcQty(val1, num)"+
"{"+
"var i = document.getElementById('gv_ctl0'+num+'_txtinput');"+
"var val2 = i.value;"+
"var out = parseInt(val1) + parseInt(val2);"+
"var lbl = document.getElementById('gv_ctl0'+num+'_lblVal');"+
"lbl.innerHTML = out;"+
"}";
Page.RegisterStartupScript("Calc", script);
}
DataTable dt = new DataTable();
dt.Columns.Add("ID");
dt.Columns.Add("Val");
dt.Rows.Add(new object[] { "1", "Shakeel" });
dt.Rows.Add(new object[] { "2", "Elizma" });
dt.Rows.Add(new object[] { "3", "Mervyn" });
gv.DataSource = dt;
gv.DataBind();
int start = 2;
for(int i = 0; i < gv.Rows.Count; i++, start++)
{
((TextBox)gv.Rows[i].Cells[2].FindControl("txtinput")).Attributes.Add("onblur", "calcQty(" + dt.Rows[i].Cells[1].Text + "," + start + ")");
}
|
|
|
|
|
I have a Web Service that has a late binding to a class lib (dll) which I modified in C# 2003. The 3rd party Web Service is using a policy included in the policycache file referenced in web.config. When I deployed the new version of the dll, I keep getting SOAP falut error and the message syntax in the outputtrace.xml file is Server unable to update --> Bad Data which doesn't tell much.
It seems that the new dll compiled after modifying the class is not using the Security policy in the policy file, Should I put again the web.config file in the project and recompile the DLL or how can I fix this situation?
Thanks a lot for your feedback.
Bob Enein
|
|
|
|
|
Hi,
I need to create a asp:CustomValidator control. I am struggling with the java script part. I need to get the control, and do not know how to do it. I am using a custom asp:CreateUserWizard control where I can arrange my controls as I like, then I have a dropdownlist which I need to get via java script.
Please can some one advise?
Regards.
|
|
|
|
|
Basically, your control has an Id property and a ClientID property. The second is the one you need. I generally add scrpt to create a variable called something like 'myListCtrlId' and make it equal to the clientId of the control.
var myListCtrlId = '<%=theList.ClientID%>';
Then you can use document.getElementById(myListCtrlId); to get access to the control in question.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
Following code is written in Visual Studio 2005 C++ for PDA(MC3000).
PDA is Motorola/Symbol's MC3000 and it has Windows CE 5.0 Operating System.
FTP Error Code 12029 meaning "Internet can not connect" as per Microsoft Documentation.
I am using following code to do FTP Send file to FTP Server:
int JSCFTPSendFile(TCHAR *tszLocalFileName, TCHAR *tszRemoteFileName)
{
HANDLE hInternetHandle = 0;
HANDLE hFTPHandle = 0;
TCHAR tszFTPServerName[256];
TCHAR tszFTPUserId[51];
TCHAR tszFTPPassword[51];
INTERNET_PORT ipFTPPortNo = 21;
_tcscpy(tszFTPServerName, _T("ftp.myftpserver.com");
_tcscpy(tszFTPUserId, _T("MyUserid");
_tcscpy(tszFTPPassword, _T("MyPassword");
hInternetHandle = InternetOpen(_T("Microsoft Internet Explorer"), INTERNET_OPEN_TYPE_DIRECT, NULL, NULL, INTERNET_INVALID_PORT_NUMBER);
if ( hInternetHandle == 0 )
{
return FALSE;
}
hFTPHandle = InternetConnect(hInternetHandle, tszFTPServerName, ipFTPPortNo, tszFTPUserId, tszFTPPassword, INTERNET_SERVICE_FTP, INTERNET_FLAG_PASSIVE, 0);
if ( hFTPHandle == 0 )
{
InternetCloseHandle(hInternetHandle);
return FALSE;
}
// upto here code works fine but when it executes FtpPutFile() I get Error code 12029
iRetStatus = FtpPutFile(hFTPHandle, tszSendFileName, tszRemoteFileName, FTP_TRANSFER_TYPE_BINARY, 0);
if ( iRetStatus )
{
bFileSent = true;
}
InternetCloseHandle(hFTPHandle);
InternetCloseHandle(hInternetHandle);
return TRUE;
}
In the above function upto "InternetConnect()" code works fine but when it executes "FtpPutFile()" I get Error code 12029.
This code works fine to conect to any standard FTP Server.
I am first connecting to PC using ActiveSync(Version 4.1) and once ActiveSync Connection established I can connect to any FTP Server(Local Network or Remote thru the gateway ) and transmit file. But if I try to send file from PDA(MC3000) to ActiveSync Connected PC(FTP Server Name is V4000) then it does not work.
I tried server name as "ppp_peer", "localhost", "V4000"(which is actual FTP Server Name for the local PC ). and it did not work.
Your help will be greatly appreciated.
Regards,
Dev
|
|
|
|
|
Hi there EveryOne
Need assistance (in the form of code) on how to do a search for images.
Thanks a million
Saaiman
-- modified at 3:40 Monday 15th October, 2007
|
|
|
|
|
Your question is too vague. Where do you want to search for images? In a database? In the file system? On the moon...?
Try and be more specific when posting questions.
Paul Marfleet
|
|
|
|
|
Hi there EveryOne
Need assistance (in the form of code) on how to do a search for images in a folder.
Thanks a million
Saaiman
(PS!! Thanks Paul for your advice)
|
|
|
|
|
You still haven't provided enough context for someone to answer your question.
What development language are you using?
Where (client/server) do you want to search for files? If you are using ASP.NET, you can search for files on the server using the static method System.IO.Directory.GetFiles . You can't search for files on the client machine using JavaScript/VBScript. Script executed by the web browser can't access sensitive resources like the file system for reasons of security.
Paul Marfleet
|
|
|
|
|
Why would your web app search for images inside a folder ? You realise you can't do this on a client PC, only on a folder on the server ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I don't know what it's called. I don't know where to start but i've seen this in some sites.
I'd like a control or a panel that's always visible to the user whether I scroll up or down the page. Like I have a really long content and when I scroll down I still want my menu (on the left) to always be visible.
Thank you.
Gerri
|
|
|
|
|
Hi Gerri
I've used the following in the past:
Wrap what you want to remain static in a div:
<div id="myPanel">
...Content...
</div>
Within your body tag, add onscroll="javascript:repositionPanel()";
Add a style something like the following:
#myPanel {background-color:white;text-align:center;
z-Index:5;position:absolute;
top:320px;left:200px;width:200px;height:410px;
}
Then in your repositionPanel() javascript function:
function repositionPanel(){
var x = (posRight()-230) + 'px';
var y = (posTop()+panelTop) + 'px';
moveObjTo('myPanel',x,y);
}
function moveObjTo(objectID,x,y) {
var objs = xDOM(objectID,1);
objs.left = x;
objs.top = y;
}
Any questions, let me know.
Cheers
Ben
-- modified at 4:40 Thursday 18th October, 2007
|
|
|
|
|
I'm sorry I can't get it to work.
Is this correct?
I found a similar control on mapleglobal.com
There are ads on the right side of the page whenever I (browser) scroll down, it scrolls down as well. Thank you.
...
<ajax:Accordion>...</ajax:Accordion>
</div>
<div class="ForumSig">Gerri</div>
|
|
|
|