P
Pablo Clavel
Hi everybody.
We have developed an application based on ASP.NET and Infopath 2003 SP1. We
have the IP forms published on a web server and from the asp pages we can
open IP forms, returning on the web response the xml with the appropiate
processing intructions.
It work's fine!!! But ...
When the client opens IP on his/her pc, a list of recent opened forms
appears, and he/she can click a forms and open a blank form that is not
processed by our application. This is a not valid form because all fields are
blank.
Well I want to close a form that has not my "sign". I search in the c# IP
code for the sign, if I don't find it I can:
- try to close the form using: thisApplication.ActiveWindow.Close(true);
(level 2) but this only works in a Click or Submit event. I don't want the
user to do a click and can't force a Submit because the form has validation
errors (all fields are empty).
- try to close using: thisApplication.Quit(false); (level 3, but the form is
signed and has the level 3). This method can't be used on the startup event,
so I used it on the OnSwitchView event, but I don't know why it doesn't
works. IP doesn't show any error message. Here is the code:
[InfoPathEventHandler(EventType=InfoPathEventType.OnSwitchView)]
public void OnSwitchView(DocEvent e)
{
m_close = m_uc.LookForSign();
if(m_close)
{
//thisApplication.ActiveWindow.Close(true);
thisApplication.Quit(false);
}
bla bla bla
}
Can you help me??
Thanks!
We have developed an application based on ASP.NET and Infopath 2003 SP1. We
have the IP forms published on a web server and from the asp pages we can
open IP forms, returning on the web response the xml with the appropiate
processing intructions.
It work's fine!!! But ...
When the client opens IP on his/her pc, a list of recent opened forms
appears, and he/she can click a forms and open a blank form that is not
processed by our application. This is a not valid form because all fields are
blank.
Well I want to close a form that has not my "sign". I search in the c# IP
code for the sign, if I don't find it I can:
- try to close the form using: thisApplication.ActiveWindow.Close(true);
(level 2) but this only works in a Click or Submit event. I don't want the
user to do a click and can't force a Submit because the form has validation
errors (all fields are empty).
- try to close using: thisApplication.Quit(false); (level 3, but the form is
signed and has the level 3). This method can't be used on the startup event,
so I used it on the OnSwitchView event, but I don't know why it doesn't
works. IP doesn't show any error message. Here is the code:
[InfoPathEventHandler(EventType=InfoPathEventType.OnSwitchView)]
public void OnSwitchView(DocEvent e)
{
m_close = m_uc.LookForSign();
if(m_close)
{
//thisApplication.ActiveWindow.Close(true);
thisApplication.Quit(false);
}
bla bla bla
}
Can you help me??
Thanks!