link btn re-direct holding session variable - asp.net

I want to use a link button to run a function 'LoadCheckListRecordEntry' which sets a session and re directs the user...However the page seems to be loading be the session is set??
ALthough the html is running the code b4 the 'DiaryEntId' actually gets set, so it returns null in the LINQ...How can i resolve this?

Related

How do I take a screenshot and close the browser after each test instance pass or fail?

I have a simple Tosca Test Case Template which takes data from a TestCaseDesign Sheet. The scenario is simple - It just launches the browser, navigates to a login page, enters username and password and clicks the login button. I have just two values for username and two values for password in the TestCaseDesign Sheet.
I linked the TestCaseDesign Sheet with the Test Case Template and generated two test instances.
Now, when I select and run these two test instances using the Scratchbook, I would like that the browser automatically closes after each test instance passes or fails so that the next test instance can open a new browser as a first step.
Also, I would like to take a screenshot before the browser closes.
How can I achieve that using Tosca?

How to catch click to dial events in Unified Service Desk?

The event raised by clicking on a phone number will either be of the form "tel:" or "skype:". Here are the steps I've followed so far to enable a window navigation rule to capture the event, and I've attached events to the rule to actually see the action get fired in the Debugger. Still, even with navigation rules set to capture tel: and skype:, the action will never fire in USD Debugger. Here is the general approach I've used so far (From another post):
Create a Windownavigation rule.
Don't put anything into the entity Settings but put "tel:" or "skype:" into the URL TextBox.
Routetype will be Popup
Target will be Tab (or registercard, at least I think that's the name for it in english - I'm using a german one)
Define None as Action in result for your Windownavigationrule
Create your own Action to resolve when the Navigation rule is triggered
Set your own hosted control (In this case I use the CTIConnector class.)
Define an Actionname for your Action that will be exectued (I named it "MakeCall" in CRM)
Set Data to [[SUBJECTURL]] so the URL ist given to the Action als Parameter.
Override the method DoAction from your hosted control
Just 2 -3 points to verify.
Do you have a UII action with the name "MakeCall"? If that is there then only your code will be triggered from DoAction.
In case, if you have above in place please check whether your action calls and other records are added to the respective configuration reocrd?

ASP.NET DateTime Column in Database Getting Set to Current Date on Page Load

I'm trying to solve an issue where a database column is getting set when navigating to a page in an ASP.NET site. This is a quote management web application, and when opening a quote and navigating to a certain page, the "Expiration Date" is automatically updated to the current date. I have verified that this is occurring prior to triggering the Page_Load function in the ascx.cs file. I have tried to trace what is being run prior to this, but I'm afraid my knowledge of ASP.NET is insufficient, and I don't know exactly where to look. From the pieces I can tell are run prior (for example, the aspx.cs file), I see nothing to indicate any alterations to the record.
When I dig deeper, it seems almost as if the change is taking pace upon leaving the main landing page when editing a quote. If I update the value and travel to any page for the quote except for the main page, it stays the same. And I can travel to the main page, check the record in the database, it stays the same. But it seems like as soon as I navigate from that main page, the Expiration Date will change to the current date. Is there somewhere I can check to see if that's what's happening?
-- EDIT --
Maybe a detail list of actions might help...
View list of quotes in system
Click "Edit" link for quote
View "Quote Details" page, which is first page upon edit access
Look at database query for quote to see exp date is still proper
value
Click "Quote Options" navigation link
See expiration date in "Quote Options" has now changed to current
date
Check database query to see that without performing a known save to
the database the exp date value has updated in the database
Perform update to quote to reset exp date
View any other page in quote edit, return to "Options", see exp
date has not changed again from reset value
Verify proper date with database query
Revisit "Details" page
Again verify correct date with database query
Travel to any other page and then to "Options", or go straight
to "Options", see that exp date has changed to current date
This is the HTML on the link used, which appears to be identical on the other pages...
<a class="tabOff" id="ContentPlaceHolder1_linkButtonAddEditShipping" href='javascript:WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions("ctl00$ctl00$ContentPlaceHolder1$linkButtonAddEditShipping", "", true, "", "", false, true))'>Quote Options</a>
I solved the problem. Sort of. I did discover that the save function was being triggered when leaving the "Details" page, even though no save action was being explicitly activated. The problem was resolved by getting the expiration date from the database at the beginning of the function, and if one was set, pushing that value back in at the very end of the function. While this has in effect prevented the value from being "overwritten", I am still unable to determine why the save function was being triggered, and unable to determine what actions within that function are setting the value to be the current date

What sets Page.User.Identity.Name

I keep track of the current logged in userID and base the behavior of my site on this value. My code sets the logged in user ID with this statement:
FormsAuthentication.SetAuthCookie(UserID.ToString(), true);
Subsequently, I read this value from Page.User.Identity.Name.
This works fine on my desktop, but on my server, I set it to 8 and it comes back 20. I am trying to figure out what can set Page.User.Identity.Name to a value and when this happens.
Thanks...
FormsAuthenticationModule handles Application_OnAuthenticate and assigns the HttpContext.User to a prinicipal object which is in turn used by Page.User.Identity.Name.
Isn't there a time difference issue on the server and your desktop?

ASP.Net links won't disable if done during postback

I'm still fairly new to ASP.Net, so forgive me if this is a stupid question.
On page load I'm displaying a progress meter after which I do a post back in order to handle the actual loading of the page. During the post back, based on certain criteria I'm disabling certain links on the page. However, the links won't disable. I noticed that if I force the links to disable the first time in (through debug) that the links disable just fine. However, I don't have the data I need at that time in order to make the decision to disable.
Code Behind
If (Not IsCallback) Then
pnlLoading.Visible = True
pnlQuote1.Visible = False
Else
pnlLoading.Visible = False
pnlQuote1.Visible = True
<Load data from DB and web service>
<Build page>
If (<Some Criteria>) Then
somelink.Disable = True
End If
End If
JavaScript
if (document.getElementById('pnlQuote1') === null) {
ob_post.post(null, 'PerformRating', ratingResult);
}
ob_post.post is an obout js function that does a normal postback and then follows up with a call to the server method named by the second param. then followed by the call to a JavaScript method named by the third param. The first parameter is the page to post back to. A value of null posts back to the current page.
The post back is working fine. All methods are called in the correct order. The code that gives me trouble is under the code behind in bold. (somelink.disabled = True does not actually disable the link) Again, if I debug and force the disabling of the link to happen the first time in, it disables. Does anyone know what I might do to get around this?
Thanks,
GRB
Your code example is using the IsCallBack check, while the question text talks about the IsPostback Check. I'd verify that you're using Page.IsPostBack in your code to turn off the links.

Resources