|
I use this code to redirect aspx page :
in locahost that run open Default.aspx page
but in http://tracklocation.somee.com/LocationService.asmx
it do not any thing . Somebody help me
[WebMethod]
public string DataLocation(string location)
{
string url = "http://tracklocation.somee.com/Default.aspx?id=" + location
Context.Response.Redirect(url);
location = Server.UrlDecode(location);
return location;
}
|
|
|
|
|
let your web service return the url to redirect to, and redirect to it from the calling web page.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Web services cannot redirect to a web page. The caller is usually not a browser so how is the caller going to know to open a browser up and display a URL??
|
|
|
|
|
I have an asp.net web page with two droplist controls. Selecting an itme in the first control causes a database query, and the 2nd droplist is populated with the query results.
This works fine when I'm running under the debugger on my local box.
However, when the site is deployed (same domain as my box and the database), it does not always populate the 2nd box. In fact, the SelectionChanged event handler for the 1st droplist doesn't get called at all. If it doesn't work, I can usually make it work after refreshing the page (with F5) a couple of times.
Both droplists are set with autopostback=true and viewstatemode=enabled .
This happens in all browsers.
There is currently no code being executed if IsPostBack is true.
This morning, it would happen every time I opened the browser and went to the page in question (and that's how I found out it wasn't even hitting the event handler). I added some debugging code, and now it seems to work fine, and I now can't get it to fail. I even deleted the three lines of debugging code, and it still works. This tells me it's not really fixed.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
I found a couple of possible fixes (can't confirm they are indeed fixes, though).
In the containing UpdatePanel , set ChildrenAsTriggers="true"
In the DropList element itself, set CausesValidation="false"
Since I haven't been able to get this problem to happen yet today, I won't know if the fix isn't a fix until someone reports the problem again. :/
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
Dear all,
I am writing to seek assistant, in how do I assign my queries below to specific roles. I am currently not storing my roles for any user in my db server. Is this task still plausible? Can this task by done using either using 'string array' roles (i.e. string[] userRoles = new string[] { "full", "trial" } ), or using 'Group By' function in linq qeuery?
public bool full(string username, string password)
{
var query =
return query.FirstOrDefault() != null;
}
public bool trial(string username, string password)
{
var query =
return query.FirstOrDefault() != null;
}
Many thanks for help and time.
|
|
|
|
|
The best practice is to store role in db but you can also store in dictionary<string uname,="" string="" role="">
|
|
|
|
|
Thank you so much for your response. Is their a way to group or name the queries, so i can compute the following logic:
if (user & password match from full query)
{
return string = "full status"
}
else
{
return string = "trial status"
}
Is their some function or framework i could look into. please help.
Thank you
|
|
|
|
|
You can simply use switch case. Or its better if you can share your both the queries.
|
|
|
|
|
Hi, thank you for your reply back and you suggestion on 'switch back'. I will look into this function.
Currently this what my queries look like:
public User trial(string username, string password)
{
string[] roles = new string[] { "trial"};
var query = from s in db.Subs
join u in db.Cust on s.sUID equals u.uID
where s.sExpiryDate >= DateTime.Now &&
u.uUsername == username &&
u.uPassword == password
select u;
return query.FirstOrDefault();
}
public User full(string username, string password)
{
string[] roles = new string[] { "full"};
var query = from s in db.Subs
join u in db.Cust on s.sUID equals u.uID
u.uUsername == username &&
u.uPassword == password
select u;
return query.FirstOrDefault();
}
Any help or suggestion, would be really appreciated. Thanks in advance.
|
|
|
|
|
In .ascx
===========
<div id="Divwatermark" class="watermark" visible="true" runat="server">
<p align="center">Cancelled</p>
</div>
Code Behind
=================
if True then
Divwatermark.Visible = True
Else
Divwatermark.Visible = False
End If
Even after the IF condition evaluates to TRUE and Divwatermark.Visible = True is getting executed, Divwatermark.Visible remains FALSE. Help me how to set the visibility of Divwatermark TRUE. Thanks in advance.
Nandan Basak
|
|
|
|
|
Hi,
I trying to display Videos which are private and will be displayed only on my website or when I login to Youtube. Can anyone help me in this regard.
|
|
|
|
|
Hello Experts,
This is my very first post here. so, please take easy on me.
I wrote a stored proc that takes 4 parameters and inserts into the db.
I have tested it using SSMS and it works great but I can't get it work with my .net app.
No errors but just doesn't work.
This is supposed to go live on Tuesday and I must give a demo by Monday.
The insert bit is the last task and is supposed to be easy.
Can someone please help?
Code is below and thanks a lot in advance.
Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.Web.UI.ImageClickEventArgs)
Dim questld As HiddenField = DataList1.FindControl("HiddenField2")
For Each item As DataListItem In DataList1.Items
If item.ItemType = ListItemType.Item Or item.ItemType = ListItemType.AlternatingItem Then
Dim positionid As Integer
Dim choiceid As Integer = 0
Dim choicetext As String = ""
'positionid = CType(item.FindControl("Label3"), Label).Text
positionid = CType(item.FindControl("HiddenField2"), HiddenField).Value
Dim anstype As HiddenField = item.FindControl("HiddenField1")
Select Case anstype.Value
Case "S"
Dim rbl As RadioButtonList = item.FindControl("RadioButtonList1")
choiceid = rbl.SelectedValue
SaveVotes(positionid, choiceid, choicetext, "")
Case "M"
Dim cbl As CheckBoxList = item.FindControl("CheckBoxList1")
For i As Integer = 0 To cbl.Items.Count - 1
If cbl.Items(i).Selected Then
choiceid = cbl.Items(i).Value
SaveVotes(positionid, choiceid, "NA", "")
End If
Next
Case "T"
Dim txt As TextBox = item.FindControl("TextBox1")
choicetext = txt.Text
SaveVotes(positionid, 0, choicetext, "")
End Select
End If
Next
DataList1.Visible = False
End Sub
Private Sub SaveVotes(ByVal qid As Integer, ByVal cid As Integer, ByVal ct As String, ByVal cuser As String)
Dim al As ArrayList = CType(Session("AnswerList"), ArrayList)
'Dim s As String
If al Is Nothing Then
Response.Redirect("Thanks.aspx")
End If
Dim connStr As String = ConfigurationManager.ConnectionStrings("BallotsConnectionString").ConnectionString
Dim conn As New SqlConnection(connStr)
Dim cmd As New SqlCommand("InsertBallots", conn)
cmd.CommandType = CommandType.StoredProcedure
Dim p1 As New SqlParameter("@qid", qid)
Dim p2 As New SqlParameter("@cid", IIf(cid = 0, DBNull.Value, cid))
Dim p3 As New SqlParameter("@ct", IIf(ct = "", DBNull.Value, ct))
Dim p4 As New SqlParameter("@cuser", Session("UserName"))
cmd.Parameters.Add(p1)
cmd.Parameters.Add(p2)
cmd.Parameters.Add(p3)
cmd.Parameters.Add(p4)
conn.Open()
cmd.ExecuteNonQuery()
conn.Close()
End Sub
modified 15-Mar-14 19:57pm.
|
|
|
|
|
>> No errors but just doesn't work
really ? there are always errors - you just need to know where to look
first off, not that it will likely show much, is that ExecuteNonQuery() does return an Int32 value for RowsAffected - that you arnt looking at - I would be irrespective of other issues
So, the real crux is, have you checked wether your database user (that you are likely connected to the database with) has permissions to the database and execute sql/stored procs ?
I would be looking at the database and event logs ....
Im always suspicious of connections to databases - so while you're trying to get it to work, after your
conn.Open()
I would add something like
Console.WriteLine("State: {0}", conn.State) and set a breakpoint on that line so I could check for sure
I cant think of anything else obvious though
|
|
|
|
|
Garth, thank you very much for your assistance.
Yes, I have checked for permission.
I logged into the db with same account that the app is using.
I was able to insert and delete records using that account.
So, I can confidently rule that out.
I do want to point out sir that when I commented these lines out:
'If al Is Nothing Then
' Response.Redirect("Thanks.aspx")
'End If
I was able to begin to insert records into the database.
My question is why did it work with my other app and not with this current app project.
Also, for some reason, I am having problems deleting the records that I inserted.
Reason I am mentioning this is if it has anything to do with the lines I commented out. It doesn't to from the look of things.
I will add the line you asked to, test and report back.
I wish there was a way to rewrite this entire code, the button1_click portion of it.
That will give me more control.
|
|
|
|
|
I have solved it by rewriting the stored proc.
That was the culprit. I suppose you are right and thanks for pointing to that direction.
|
|
|
|
|
Hi
I'm coding an application sort of a chat. but the challenge that I'm facing is. How do I allow more than one user to login in my browsers IE and Crome in my PC?
|
|
|
|
|
How to implement facebook share functionality using jQuery ???
any thoughts ???
Thanks
|
|
|
|
|
|
Hi,
I have implemented facebook share button functionality in my application using below code. But that is not working in my application. can u provide some suggestion to solve this prob.
Snippet:
http://www.facebook.com/sharer.php?s=100&p[url]" + DomainName + "&p[images][0]=" + ImgUrlValue + "&p[title]=" + ProductDesc + "&p[summary]=" + product summary.
|
|
|
|
|
this is 3rd re-post so far. stop that.
|
|
|
|
|
Master page :
there is a script manager in master page. In child page i am trying to trigger button's server click event. i can call jquery click event on its click..i cant' call its server side event
Content page :
<asp:button id="btnSignup" runat="server" text="Create Account" cssclass="button cta btn btn-primary btnSignup" onclick="btnSignup_click">
protected void btnSignup_click(object sender, EventArgs e)
{
}
am i missing anything ?
|
|
|
|
|
instead of önserverclick use onclick and still if it doesn't work then put everything under <updatepanel><contenttemplate>
|
|
|
|
|
Hi Techies
I cached a page using the directive and attribute VarByParam.It worked fine and my problem is I am having a web page with a Panel control and inside the panel two text box were used and the ID for those text box are txtTest1 and txtTest2 with the text Test1 and Test2 respectively. All my need is to partially cache this particular panel along with their child controls and its value means the two textboxes and its text. Please give me the solutions.
Note: User Control should not be used
modified 16-Mar-14 23:12pm.
|
|
|
|
|
I used some examples but doesn't work on the computer or movil device.
when i run the proyect (f5) in the proyect this code works but when i go to chrome or explorer directly doesn't work. How can i do.....
This is the code.
one:
Dim player As New System.Media.SoundPlayer
player.SoundLocation = ("c:\sonidos\error.wav")
player.Play()
two:
Dim sp As SoundPlayer
sp = New SoundPlayer(My.Resources._error)
sp.Play()
Thanks a lot.
|
|
|
|