|
hi,
what is the function of PostBackurl ?
i drag the Button1 Default.aspx and in Default.aspx.cs I intilize a
int i; and
protected void Button1_Click(object sender, EventArgs e)<br />
{<br />
<br />
Button1.Text = "" + i; i++;<br />
}
after site run ,when i click on the Button1 ,Button1.Text show '0'.its ok........ but when i click again it still Button1.Text show '0'.
but i want whenever i press the button1 then int i update every time
.......
|
|
|
|
|
zeeShan anSari wrote: what is the function of PostBackurl ?
MSDN[^] not working in Pakistan today? Or did it just not occur to you to read the documentation?
zeeShan anSari wrote: protected void Button1_Click(object sender, EventArgs e)
{
Button1.Text = "" + i; i++;
}
Where is i defined? Is it a class-level variable? Unless you cache the value of this variable between postbacks, for instance by using ViewState , it will be initialized to 0 on every postback.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
i initialized under :
public partial class _Default : System.Web.UI.Page
then how i can increment the int i value
|
|
|
|
|
zeeShan anSari wrote: then how i can increment the int i value
Use some stateful object. Session, ViewState, Cache etc.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
i cant get the value of any control in the javaScript function
function clickIt(droplist,x)
{
//alert is working
alert('it is step2');
//color of the row 2 which droplist belongs changes
droplist.parentElement.parentElement.style.backgroundColor='#88AAFF';
//HERE IS PROBLEM i Get Undefined in Alert
alert( droplist.parentElement.parentElement.cells[0].value);
}
|
|
|
|
|
You need to find the control via:
document.getElementByid("Codtrolid")
/***********************/
Parwej Ahamad
g.parwez@gmail.com
/***********************/
|
|
|
|
|
Hi All,
I would like to collect some information about the disadvantages of xslt programming. We have made a module frame work (in .net) which accept xsl and data can be returned by using xml.Then it is transforming. We have plan to use this module as much possible but got a chance to read some articles that indicating that xslt will access more memory and cpu usage and thus reduce the perfomance.
It would be really appreciating If anybody can provide me some proper information/guidance in that.And I have read some disadvantages of using ajax in xslt.More details in this topic also wonderful.
Please show me the right way...
Thanks in advance and expecting your reponses,
Rahul..
SoftwareDeveloper(.NET)
|
|
|
|
|
Rahul.P.Menon wrote: I would like to collect some information about the disadvantages of xslt programming.
This question is of too broad a nature to be answered properly within a programming forum. Also, it isn't relevant to the ASP.NET forum. I'm not sure what you mean by 'disadvantages'? XSLT was designed for a specific purpose - performing transformations on XML documents. This could be from one XML schema to another, or to a different document format e.g. HTML or a flat file. It is usually preferable to use XSLT for this purpose rather than a general-purpose language.
Rahul.P.Menon wrote: And I have read some disadvantages of using ajax in xslt.More details in this topic also wonderful.
Without an understanding of what you are trying to do, it's difficult to offer advice. What have you read? How do you want to make use of AJAX and XSLT?
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Thanks much for the responses..Let me put more detail to get an exact advice..
For example if we have simple form to submit in our scenarion and see the two possibilities
1) A .net application made and complied and which can read the xsl and transform and shows up the data in an ascx page. So for the above scenario we can use that and develop a xsl to design the form then submit it using a form post and passing the data to the procedure specified in the xml to inserting/updating
2) This way is straight forward as we can design a form using asp.net and compile the code and add the logic to submit.but in this case again need to compile the code is required and if any more changes again compile the code. But in the first way only need to change the xsl file and no compile required.
By considering these two ways which way you will suggest and why...Please count the perfomance measures also while decide a way..That can be a right advice for me for the scenario.
Thank you,
Rahul..
SoftwareDeveloper(.NET)
|
|
|
|
|
Rahul.P.Menon wrote: By considering these two ways which way you will suggest and why...Please count the perfomance measures also while decide a way..That can be a right advice for me for the scenario.
What do you think? I'm not going to tell you what to do. As a developer, you should be able to evaluate different solutions to a problem and make a judgement about which is most appropriate given the circumstances.
Here are some points you might want to consider. What is the relative complexity of the two approaches? Which of them do you, or your colleagues have the technical skills to implement? What time/resources do you have at your disposal, and what do you think you can realistically achieve within their constraints? What are your customer requirements, and how complicated an approach do they warrant?
I don't know anything about your company so I can't answer these questions for you. All I can suggest is that you consider these points when you make your decision.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
I know all these measures and I think finally our discussion went out of scope..I was just searching for the disadvantages of xslt programming as I saw in many articles that it will slow down the perfomance..I was not really looking for the feasibility of the application and the scenario provided is to just make it in detail..
I don't think that my query really needed any company name or SRS to get it answered..Just looking for some responses from those who really knows the disadvantages of xslt. Thats it..
Thank You,
Rahul..
An answer comes from knowledge really differs from the answer which is just build for it
|
|
|
|
|
Rahul.P.Menon wrote: I know all these measures and I think finally our discussion went out of scope..I was just searching for the disadvantages of xslt programming as I saw in many articles that it will slow down the perfomance..I
I don't think the discussion did go OT. You can't discuss the pros/cons of a particular technology without framing the discussion in in some sort of context. The XSLT language was designed to perform transformations on XML documents. It can therefore be considered a preferred tool for such work. Is it the right tool in your ciscumstances. Only you can answer this. You state that you have read documents claiming that using XSLT degrades performance. Have you validated these claims for yourself? Be prepared to challenge assumptions; run your own tests. Performance shouldn't be your only consideration. You may find that an XSLT solution is marginally slower compared to another approach, but the benefits in terms of maintainability far outweigh the costs. Ultimately, you must decide what the best approach based on your own particular circumstances.
Rahul.P.Menon wrote: I don't think that my query really needed any company name or SRS to get it answered..Just looking for some responses from those who really knows the disadvantages of xslt. Thats it..
I'm not interested in the name of your company. My point was that you should choose the technologies that work best for you. Conduct you own evaluation of each approach, considering contextual factors such as time, cost, complexity, maintainability. Then make a decision that you are comfortable with.
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Rahul.P.Menon wrote: We have plan to use this module as much possible when appropriate
Not every problem is a nail and therefore not every solution is a hammer.
led mike
|
|
|
|
|
What I want to do is create a templated control to display two dropdowns in different ways. The dropdowns will be doing the same thing, but must look different on different pages.
I'm going for something like this:
<br />
<mycontrols:cascadingdropdowns><br />
<controltemplate><br />
<div>***<dropdown1 />***</div><br />
<div>***<dropdown2 />***</div><br />
</controltemplate><br />
</mycontrols:cascadingdropdowns><br />
where Dropdown1 and Dropdown2 are some properties of type DropDownList. Can anyone tell me if this is possible?
I have gotten up to the point of creating the ControlTemplate property with type ITemplate, andthat works, but I am not sure how to go about making it so I can have the dropdown1 and 2 properties
|
|
|
|
|
Hi,
I am using a javascript onclick function to get values of an input button. Then I am using webservices to input the value in table. This is working fine with IE7,IE6. But not working for Firefox. Part of the code is given below:
function SegmentUpdate(okButton)
{
// Get a refence to the containing cell, it's up a few levels in the DOM
var containingCell = okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
cancelButtonName = okButton.name.replace('OkButton', 'CancelButton');
cancelButton = document.getElementById(cancelButtonName);
// Get the necessary Id's (They are written on the table data element for this cell).
var segmentId = containingCell.sourceSegmentId; // Here the problem is. containingCell not accepting value in the variable segmentId.
var userId = containingCell.userId;
var languageCode = containingCell.languageCode;
var milestoneName = containingCell.milestoneName;
var contextualLevel = containingCell.contextualLevel;
var isArchived = containingCell.isArchived;
// Get a reference to the relative form elements (Their names are written on the table data element for this cell).
var txtTQMReasonClientId = document.getElementById(containingCell.txtTQMReasonClientId);
var ddlTQMReasonClientId = document.getElementById(containingCell.ddlTQMReasonClientId);
divTargetTextClientId = document.getElementById(containingCell.divTargetTextClientId);
txtOverrideTranslatedTextClientId = document.getElementById(containingCell.txtOverrideTranslatedTextClientId);
txtOverrideTranslatedTextClientId = document.getElementById(containingCell.txtOverrideTranslatedTextClientId);
divPanel2ClientId = document.getElementById(containingCell.divPanel2ClientId);
panel1Id = containingCell.divPanel2ClientId;
// Get the values from the form elements to make the update
var reason = "";
if (txtTQMReasonClientId != null)
{
reason = txtTQMReasonClientId.value;
}
var reasonId = -1;
if (ddlTQMReasonClientId != null)
{
reasonId = ddlTQMReasonClientId.value;
}
var overrideText = "";
if (txtOverrideTranslatedTextClientId != null)
{
overrideText = txtOverrideTranslatedTextClientId.value.trim();
}
ABCD.WebServices.Approval.OverRideTargetSegmentText(segmentId, userId, overrideText, reasonId, reason,
languageCode, milestoneName, contextualLevel, isArchived.toLowerCase(), OnUpdateTargetSegmentComplete);
}
|
|
|
|
|
Do you know at what point your script is falling over (does it error or does it simply not update the DB)? Are your variables being populated before the web service call is made?
Clean code is the key to happiness.
|
|
|
|
|
This is error and hence not updating DB.
No the variables are not populating. The error is with containingCell. This is not extracting related values.
|
|
|
|
|
okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
That's a hell of a lot of parentNode references. Far to many.
At what point does the script fail? What is the error message?
only two letters away from being an asset
|
|
|
|
|
Yes you are right-a lot of parentNode references. But I have 11 variables to populate, this is why 11 times this is written. I have taken only 1 parentNode, but this has given me undefined for the variables. [I have used alert(variables).]
The script is ok for IE. But using Mozilla Firefox. This gives above error on the same point "undefined". Hence, not populating variables and the DB. Either "parentNode" not accepting or I miss the syntax. Please help me to solve this problem.
|
|
|
|
|
MSinha wrote: I have taken only 1 parentNode
okButton.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode;
Well of course there is only one parentNode for each object. However, it looks like you 11 levels deep. At that point you should just go directly to the element you are trying to get to, document.getElementById();
MSinha wrote: [I have used alert(variables).]
How about debugging in a more professional manner, like using a debugger. Alert is not a diagnostic tool.
only two letters away from being an asset
|
|
|
|
|
var segmentId = document.getElementById(containingCell.sourceSegmentId);
Using above, I gets null for the variable segmentId both in in IE7 and Mozilla Firefox. The version for FF is:(Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11). Please help me.
|
|
|
|
|
We have an in-house, client side grid thingy, a fancied up HTML table built by a DataRepeater, and do our own ajax using the onblur events of the input controls in that table.
Now I'd like to replace that grid with a DataList, to get a detail view for editing more details provided in the grid view, but I would still like to retain my existing in-grid editing as is, without postbacks, or having to enter or exit edit mode. Is there any way to combine these two? Can I gloo on an onblur event to the controls rendered by the DataList and retain my current ajax channel?
|
|
|
|
|
Am extremely sorry for posting my same query again. Thing is, i dint hav any solution. so i've made myself clear by posting the entire code. Plz try to answer my query if time n patience permits. Both the code inside code1 and code2 are not working. seperately i've checked it out.
]]>;
<asp:content id="Content1" contentplaceholderid="ContentPlaceHolder1" runat="Server">;
;
function length()
{
if(document.all('txtMessage').value.length>10)
{
alert('Too many characters')
}
}
<%script type="text/javascript">;
function length()
{
var a = document.getElementById("TextBox1").value.length;
if (a >10)
{
alert("Too many characters");
}
}
<asp:textbox id="TextBox1" runat="server" style="z-index: 100; left: 324px; position: absolute;<br mode=" hold=" /"> top: 128px" TextMode="MultiLine">
;
<asp:button id="Button1" runat="server" style="z-index: 102; left: 381px; position: absolute;<br mode=" hold=" /"> top: 210px" OnClientClick="length()"; Text="Button" >;
;
The most difficult phase of life is not when no one understands you ; It is when you don’t understand yourself.
|
|
|
|
|
Raam check first your javascript function is properly get called
comment out every thing and just put alert check are you getting the alert?
Thanks and Regards
Sandeep
If If you look at what you do not have in life, you don't have anything,
If you look at what you have in life, you have everything... "
|
|
|
|
|
Hi,
Firstly, I would suggest you rename your function as length is a DOM keyword. The below should work fine:
<script type="text/javascript"><br />
<!--<br />
function checkLength()<br />
{<br />
var a = document.getElementById("TextBox1").value.length;<br />
<br />
if (a > 10)<br />
alert("Too many characters");<br />
}<br />
</script><br />
Clean code is the key to happiness.
|
|
|
|