|
hey matt...thanks for teh reply man that sorted it
|
|
|
|
|
What was the issue? Was the list not getting the correct values or did a "SingleOrDefault()" call take care of it?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Im using a session variable to pass the user ID from the Index to the Create in the HomeController. ATM the user can use a drop down to select their name from the list of users and click 'View' to list the holidays they have previously booked. From there the user can click 'create' which will bring the user to a page which enables them to create a new holiday. From here they have to select their name again from the drop down list.
I want to store the users ID from the previous drop down so it will update automatically if they try to create another holiday (to replace the second drop down)
Im using a session variable to do this, iv put
Session["userameID"] = currentID;
in my view. Iv break pointed it just after and if I hold my mouse over 'currentID' it displays the correct ID of the user.
So iv tried to pass this down to the create method using
string xx = (string)Session["usernameID"];
However string 'xx' is returning NULL,., (tested with breakpoint)
I then placed the entire session in the view
Session["userameID"] = HolidayDate;
string xx = (string)Session["usernameID"];
and string 'xx' is still returning null.
Is it not meant to return the userID???
Thanks for any replys
|
|
|
|
|
I dont know whether this a typo in your question or is it bug in your code but
Session["userameID"] = currentID;
and this
string xx = (string)Session["usernameID"]; definitely dont match.
The spelling of the session key is different. one place it is userameID and another it is usernameID .
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|
opps, thanks for that feeling tired this morning and missed that.
Anyway i
|
|
|
|
|
I want to store the users ID from the previous drop down so it will update automatically if they try to create another holiday (to replace the second drop down)
Im using a session variable to do this, My View:
//this coverts the user ID to a string and stores it in
session["usernameID"]
string userID = currentPersonID.ToString();
Session["usernameID"] = userID;
-------------------------------------------------
//My Create:
//catches the session["UsernameID"], stores it in string 'xx'
//converts it to an int and stores it in currentPersonID
//then store the value of currentpersonID in the model
public ActionResult Create()
{
string xx = (string)Session["usernameID"];
int? currentPersonID = Convert.ToInt32(xx);
HolidayList model = new HolidayList();
model.currentPersonID = currentPersonID.Value;
-------------------------------------------------
This all works fine, howeve how do I display the value properly in the view?
Where I was using :
@Html.DropDownListFor(model => model.PersonId, new SelectList(ViewBag.Id, "Value", "Text"),"---Select---")
i've tried:
@Html.TextBoxFor(model =>model.currentPersonID, "currentPersonID")
//and
@Html.LabelFor(model =>model.currentPersonID)
hoping the correct ID would display, but only the text 'currentPersonID is displayed
please advise, thanks again
|
|
|
|
|
You try to get sessiondata in data format which you have stored like
if userid is integer then try to get data in integer only use type casting
|
|
|
|
|
Hi All,
I want to support multiple languages in my web application, here are few queries that I have
1) Do I need to install the fonts for those languages?
2) Using resource file will help me to change the images and text on the page for that language.
3) Is the Operating system involved anywhere in this process, e.g. if my application is being accessed by a person in China with a Chinese OS installed on his machine, will it affect?
Expecting your expert comments on the above.
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
This article will definitely answer most of your queries.
Using Globalization and Localization in ASP.NET[^]
Twenty years from now you will be more disappointed by the things that you didn't do than by the ones you did do. So throw off the bowlines. Sail away from the safe harbor. Catch the trade winds in your sails. Explore, Dream. Discover.
|
|
|
|
|
Thanks for your reply Rahul,
I tried the resource file approach but somehow the label text is not changing...
Is there something that I am missing?
Thanks & Regards,
Pramod
"Everyone is a genius at least once a year"
|
|
|
|
|
I don't consider an expert myself, but I have some comments
1. Install WHERE? If you use web fonts or similar technique to display text on your site then yes, you need to have the fonts that support your languages. If you use one of standard fonts, then users have to have it installed on their machines.
2. Yes, resource files will help you but it is nowhere near the out-of-the box feature. Plan ahead and don't hardcode anything that can be different in other languages.
3. It depends. Not strictly the OS, but regional settings on user machine. Keep in mind that many elements may display differently especially if you what to parse user input. For example decimal separator may be '.'(dot) or ','(comma), currency symbol may be before or after amount and date formats are pure wild
--
"My software never has bugs. It just develops random features."
|
|
|
|
|
Please go through this atricle once..
<a href="http://www.codeproject.com/Articles/13153/Multilingual-Support-for-Web-Applications">Multilingual Support for Web Applications</a>[<a href="http://www.codeproject.com/Articles/13153/Multilingual-Support-for-Web-Applications" target="_blank" title="New Window">^</a>]
|
|
|
|
|
Which free Google API I can use to show,save and edit googlemarkers in map?
|
|
|
|
|
I would start looking here[^] first.
There are only 10 types of people in the world, those who understand binary and those who don't.
|
|
|
|
|
Hello,
I created a WCF service into my asp.net app in order to store some messages into queue using MSMQ before send them to users. The first part work fine because i can see all messages in a pickup directory with Windows Explorer. I also can see the message number using windows service manager throw my private queue.
The second part don't work i.e my messages aren't sent and i have no error message. I don't understand where the problem come from. The code i use is following :
msmqQueuePath is my Queue name
Public Sub GetMailMessages() Implements ISvcEmailManagement.GetMailMessages
Try
Dim _msmqQueue As New MessageQueue(msmqQueuePath)
_msmqQueue.Formatter = New BinaryMessageFormatter
_msmqQueue.MessageReadPropertyFilter.SetAll()
AddHandler _msmqQueue.ReceiveCompleted, AddressOf msmqQueue_ReceiveCompleted
Dim returnValue As IAsyncResult
returnValue = _msmqQueue.BeginReceive()
signal.WaitOne()
Return
Catch ex As Exception
Dim Msg As String = ex.Message
Throw ex
End Try
End Sub
The receiveCompleted function is :
Public Sub msmqQueue_ReceiveCompleted(ByVal sender As Object, ByVal e As ReceiveCompletedEventArgs)
Try
Dim emailMsg As EmailEntities.CEmailMessage = e.Message.Body
Dim mailMessage As MailMessage = New MailMessage()
mailMessage.To.Add(New MailAddress(emailMsg.sTO))
mailMessage.From = New MailAddress(emailMsg.sFROM)
mailMessage.Subject = emailMsg.sSUBJECT
mailMessage.Body = emailMsg.sBODY
Dim oclient As SmtpClient = New SmtpClient()
Try
oclient.DeliveryMethod = SmtpDeliveryMethod.SpecifiedPickupDirectory
oclient.Send(mailMessage)
Catch ex As SmtpFailedRecipientsException
Dim i As Integer
For i = 0 To ex.InnerExceptions.Length - 1
Dim status As SmtpStatusCode = ex.InnerExceptions(i).StatusCode
If (status = SmtpStatusCode.MailboxBusy) Or (status = SmtpStatusCode.MailboxUnavailable) Then
System.Threading.Thread.Sleep(5000)
oclient.Send(mailMessage)
Else
MsgBox("Failed to deliver message to {0}", MsgBoxStyle.Information, ex.InnerExceptions(i).FailedRecipient)
End If
Next i
Catch ex As SmtpException
Dim msstatus As String = ex.Message
End Try
Catch ex As SmtpException
Dim msstatus As String = ex.Message
Catch ex As Exception
Dim msstatus As String = ex.Message
End Try
End Sub
Thanks a lot for any help
|
|
|
|
|
We are using crystal report 10.2 in our web application which is running on dotnet framework 2.0.Some time we are getting an error export report failed.But if we put an enter in the database field,report is getting generated without any error.Our data base is oracle 10g.Please help to rectify the problem.
|
|
|
|
|
I use Timer1 to refresh few parts of masterpage but the timer refresh all page, and i need to refresh only specific parts of masterpage.
Is possible to refresh part of masterpage by using Timer1 Ajax Control?
|
|
|
|
|
I'm no expert in this area but I'm somewhat familiar with it. Call an AJAX method for the specific portion(s) of the master page maybe? Or put it in an UpdatePanel?
djj55: Nice but may have a permission problem
Pete O'Hanlon: He has my permission to run it.
|
|
|
|
|
Thanks for reply.
I used UpdatePanels and masterpage get all refresh insted of refreshing only controls which are inside updatepanel.
|
|
|
|
|
|
I solved by removing other controls from updatepanels, i have put controls inside updatepanel only that controls which must be refreshed, other controls i removed from updatepanels. Now works great.
Thanks for assistance.
|
|
|
|
|
---TRY---
<div>
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="300000" >
</asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
</div>
---OR---
<asp:UpdatePanel ID="UpdatePanel4" runat="server">
<ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<asp:Timer ID="Timer1" runat="server" ontick="Timer1_Tick" Interval="300000"> </asp:Timer>
</ContentTemplate>
</asp:UpdatePanel>
|
|
|
|
|
So on the users page the user can use a drop down to select their name and then click 'view' to view the list of holidays they have previously booked. From here they can choose 'select new' which will allow the user to create a new holiday. This all works fine however I want the username to be stored from the original drop down and displayed in the creating page. Instead of having 2 seperate drop downs on each page.
I have tried:
My first drop down in my Index.chtml
@Html.DropDownListFor(model => model.HList4DD.First().HolidayDate, new SelectList(Model.PList4DD, "Id", "Name", Model.currentPersonID), "--select--")
My second drop Down on the create view:
@Html.DropDownListFor(model => model.PersonId, new SelectList(ViewBag.Id, "Value", "Text"),"---Select---")
-----------------------
I wanted to change this to the name of the user previously selected so in my get of the Index I have used:
TempData["CurrentPersonID"] =currentPersonID;
Then to replace my second drop down im trying something like:
@TempData["CurrentPersonID"]
<div>
@Html.LabelFor(model => model.currentPersonID, "currentPersonID")
@Html.ValidationMessageFor(model => model.PersonId)
</div>
Any suggestions? Thanks
|
|
|
|
|
I have implement comet.when client request to server,that request wait to server till the new message arrives.when new message arrives it get back to client.after completion of responce processing client request to server again and wait for new message.
This is working fine for upto 10 request wait at server but then after server can't responce of new request and site getting hanged and have to recycle the application pool.I found the state of all request is ExecuteRequestHandler in workerprocess of IIS.
Please tell me what should i do??
|
|
|
|
|
Try to use client side code.
may be you have used more session or application state
|
|
|
|