« first day    last day (17 days later) » 

9:25 AM
hi
 
nad
hello
let me know what you want
so that we can finish it off
can we start ?
 
yes
what have you tried ?
 
nad
I tried with Update panel
but the page was still refreshing
 
What does exactly FlAttachParty_Click function ?
 
nad
it checks and gets me the dynamic objectattachid which is required by js function
have a look
protected void btnAttachParty_Click(object sender, EventArgs e)
{
if (strMode == "A")
{
if (HidAttachVal.Value == "")
{
ObjPriCon.Open();
OracleCommand objpricmd = new OracleCommand("select xxcus.xxacl_pn_party_info_SEQ.nextval from dual", ObjPriCon);
HidAttachVal.Value = Convert.ToString(objpricmd.ExecuteOracleScalar());
ObjPriCon.Close();
}
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "AttachmentCallParty(" + HidAttachVal.Value + ");", true);
}
else
{
if (HidAttachVal.Value == "")
 
9:32 AM
I have one idea..please wait 10 min
 
nad
yeah sure.. just see it to that the page should not get refreshed
 
yes..and method 'btnAttachParty_Click' must be called.
 
nad
yes
 
Try to set ChildrenAsTriggers="true" property for UpdatePanel
 
nad
let me write the update code again
as I deleted that
just 2 mins
is this fine ?
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="true">
<ContentTemplate>
<asp:Button ID="btnAttachParty" runat="server" Text="Add" Width="150px" OnClick="btnAttachParty_Click" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnAttachParty" EventName="click" />
</Triggers>
</asp:UpdatePanel>
 
9:48 AM
yes
 
nad
ok
let me check
Not working, the page is still getting postback
 
ok..please wait
 
nad
sure
 
nad
10:03 AM
are you making some code snippet ?
 
I think that we must use AJAX.
now i am working at that
 
nad
ok
let me know if you need anything from my side
 
nad
ok
 
nad
10:27 AM
is it done ?
 
Almost..in 5-10 minutes
 
nad
sure.. :) take your time..
 
well
do you have teamviewer ?
 
nad
Nope, I m in office and here it is restrictly prohibited
u can send me the code..
or give me ur email id
i will send you the file
 
yes.
ionutmihai1995@gmail.com
 
nad
10:39 AM
ok
sended u the files
 
I'll tell you ideas here.
 
nad
ok
 
First of all, remove update panel.
 
nad
ok
done
 
Change <asp:Button ID="btnAttachParty" runat="server" Text="Add" Width="150px" OnClick="btnAttachParty_Click" />

TO

<input type="button" id="btnAttachParty" value="Add"/>
 
nad
10:44 AM
ok
now
 
Do you have included a jquery plugin in page ?
 
nad
yes
 
Which is the name of Page which have included the method btnAttachParty_Click ?
FrmAgreementMaster.aspx ?
 
nad
yes
 
ok
<script>
$(document).ready(function () {
$('#btnAttachParty').click(function () {
$.ajax({
url: 'FrmAgreementMaster.aspx?id=' + $(this).attr('id')
});
});
});
</script>
put this script
 
nad
10:51 AM
ok
now
 
put an alert() before $.ajax...
and tell me if will show it.
 
nad
ok
 
when you click button
 
nad
i added alert('Test');
and it showed me test when I clicked the button
 
ok
now in .cs file
 
nad
10:55 AM
?
 
in function protected void Page_Load
add this
if (Request.Headers["X-Requested-With"] == "XMLHttpRequest")
{
if (Request.QueryString["id"] == "btnAttachParty")
{
btnAttachParty_Click(this, null);
}
}
 
nad
inside if (!IsPostBack) or outside ?
 
at top of Page_Load function
outside
 
nad
ok
 
nad
10:57 AM
done
now ?
 
I see that you have another two requests
if(request.querystring["mode"]
and key
 
nad
yes
for checking ID and MODE
 
what i have send you put the first
 
nad
ok
done..
now ?
 
if (Request.Headers["X-Requested-With"] == "XMLHttpRequest")
{
if (Request.QueryString["id"] == "btnAttachParty")
{
btnAttachParty_Click(this, null);
}
}
if (Request.QueryString["Mode"] != null && Request.QueryString["Mode"] != "")
{
strMode = Request.QueryString["Mode"];
HidMode.Value = Request.QueryString["Mode"];
}
if (Request.QueryString["Key"] != null && Request.QueryString["Key"] != "")
{
StrMkey = Request.QueryString["Key"];
HidCefMkey.Value = Request.QueryString["Key"];
}
it is look like this ?
 
nad
10:59 AM
yes
see
if (Request.Headers["X-Requested-With"] == "XMLHttpRequest")
{
if (Request.QueryString["id"] == "btnAttachParty")
{
btnAttachParty_Click(this, null);
}
}

if (Request.QueryString["Mode"] != null && Request.QueryString["Mode"] != "")
{
strMode = Request.QueryString["Mode"];
HidMode.Value = Request.QueryString["Mode"];
}
if (Request.QueryString["Key"] != null && Request.QueryString["Key"] != "")
{
StrMkey = Request.QueryString["Key"];
HidCefMkey.Value = Request.QueryString["Key"];
}
 
now run app
 
nad
ok
2 things worked properly
page didnt refreshed and it went all right
 
so..it is all right ?
 
nad
but onclick I have called js function
that didn't worked
its not going into AttachmentCallParty(" + HidAttachVal.Value + "); function
 
I look now what posibilities i have.
 
nad
11:05 AM
yes
in the method it should go
was it working on ur side ?
 
I make another snippet
 
nad
ok
r u looking out for something?
 
wait a sec
 
nad
ok
 
11:24 AM
what does ScriptManager.RegisterStartupScript in your case ?
 
nad
it should take me to that function...
 
add is a javascript function ?
and*
 
nad
yes
 
it is a problem if you call function from client-side ?
i have one idea..we can return HidAttachVal.Value in json
then in success function from ajax
call javascript functions
 
nad
yeah we can do that way
but
after returning value in json
it should open a pop up
as mentioned in that function
with parameters
got it ?
 
11:29 AM
what contains modal ?
 
nad
here it is
var returnParameter = window.showModalDialog("../PreSales/Transactions/FrmCrm_File_Attachment.aspx?Ent‌​ity='XXACL_PN_PARTY_INFO'&Ext=pdf,jpg&mkey='" + objattchid + "'&User_Attach=N&userid=<%=Request.QueryString.Get("userid")%>", null, 'unadorned:yes;resizable:1;dialogWidth:800px;dialogHeight:350px');
it opens a page with respective entity, and id's
 
And where is HidAttachVal.Value ?
 
nad
from cs, HidAttachVal.Value is objattachid
"AttachmentCallParty(" + HidAttachVal.Value + ");" = AttachmentCallParty(objattchid)
make sense ?
 
ok..thanks
yes
 
nad
:)
 
11:34 AM
Please let me some moments.
i'm trying to implement
 
nad
take ur time
i guess u understood now how it should work
 
nad
ok
 
so..we need return following parameters
HidAttachVal.Value
<%=Request.QueryString.Get("userid")%>
two parameters no ?
 
nad
one sec
let me check again
yes these 2
rest all are called hard coded
 
11:43 AM
ok
 
nad
12:00 PM
still working ?
 
Do you know how to hit one method via ajax?
 
nad
No idea.. actually i m weak in ajax
 
I am working much on asp.net mvc.
i'm still searching
 
nad
Ok
let me also check, if i get any useful link
I m not sure
maybe this can help
http://stackoverflow.com/questions/6184759/ajax-call-function-after-success

http://stackoverflow.com/questions/23283276/execute-function-after-ajax-call-is-complete
 
I know ajax good enough
but i don't understant why it is not working on web forms
 
nad
12:06 PM
ohhh
 
i want to hit click method directly
 
nad
ok
did u see the link which I gave ?
 
yes..but not help me
 
nad
ok
 
only i need is to return an json
 
nad
12:25 PM
ok
i know u will crack it
 
nad
12:50 PM
u their ?
 
yes.
still trying
 
nad
ok
i m coming in 10mins
having a coffee break
u also have a coffee, it would help ;)
 
nad
1:12 PM
u their ?
 
nad
i m back
 
Change javascript to this
 
nad
ok
 
$.ajax({
url: 'FrmAgreementMaster.aspx/btnAttachParty_Click?id=' + $(this).attr('id')
});
and your function to this
 
nad
1:15 PM
?
 
[WebMethod]
public void btnAttachParty_Click(int id){
//rest of code
}
 
nad
ok
 
put a breakpoint and tell me if it hit method
 
nad
ok
is this fine
[WebMethod]
public void btnAttachParty_Click(int id)
{
if (strMode == "A")
{
if (HidAttachVal.Value == "")
{
ObjPriCon.Open();
OracleCommand objpricmd = new OracleCommand("select xxcus.xxacl_pn_party_info_SEQ.nextval from dual", ObjPriCon);
HidAttachVal.Value = Convert.ToString(objpricmd.ExecuteOracleScalar());
ObjPriCon.Close();
}
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "AttachmentCallParty(" + HidAttachVal.Value + ");", true);
}
else
{
if (HidAttachVal.Value == "")
 
yes
and your javascript
don't forget
 
nad
1:18 PM
?
No overload for method takes 2 arguments
at here
if (Request.QueryString["id"] == "btnAttachParty")
{
btnAttachParty_Click(this, null);
}
 
yes..comment this line
 
nad
full code ?
 
nad
ok
what about js ?
any changes?
its not going here
[WebMethod]
public void btnAttachParty_Click(int id)
on click of button
u their ?
leaving for now
will discuss this tomorrow
office is getting closed now
see u for now
 
ok
any problem i have..i could'n hit method
 
 
3 hours later…
nad
4:39 PM
u were telling some change in js ?
what was that
 

« first day    last day (17 days later) »