|
Can you show the code you have written..?
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
hey, thanks for such a quick reply....
i have a button, which when clicked, opens the calendar(calendar is inside a div whose display is none in the begining. when button is clicked, the display is 'block', so the calendar shows up.) but when a value is selected in a calendar(server control), the whole page is refreshed and the div display is 'none' again. this happens everytime i click on the calendar control....
scarface
|
|
|
|
|
scar_face wrote: when a value is selected in a calendar(server control), the whole page is refreshed
That's the way it behaves...The Calendar control included with ASP.NET uses postbacks only. If you don't want the users to notice it use AJAX update panel and keep the Calender control inside it.(Or else you can write your own javascript calender.There are plenty of them available on the web).
scar_face wrote: and the div display is 'none' again
You need to run the javascript again...You have the register the clientscript and run the script again once the page refreshes.(Or else set the display: block again)
"Don't worry if it doesn't work right. If everything did, you'd be out of a job." (Mosher's Law of Software Engineering)
|
|
|
|
|
Rather than using ASP.Net calendar, you can go for any Java Script Calendar. or use Ajax Update panel to solve your problem.
cheers,
Abhijit
CodeProject MVP
|
|
|
|
|
Standard ASP.NET Calendar control will always do the postback. It is better to use the JavaScript, DHTML Calendar Controls. So many free JavaScript, DHTML Calendar controls are available free in the web. You can also use the AJAX calendar Control which will not do full postback. If you want to strict with the Standard ASP.NET calendar control, then I would suggest you to use AJAX Update Panel which removes full post backs.
Either you love IT or leave IT...
|
|
|
|
|
Public Function PopulateList() As DataSet
Dim cmd As New SqlCommand("select qt.department as dept, qt.custid as cusid, q.qotranid as qotranid,q.qoid as qoid,q.productid as proid,q.productname as pname,q.description as descr,q.qnty as qnty,q.price as price,q.tax as tax,q.total as total from quotation q ,quotetran qt where q.qotranid='" & ddlqo.SelectedItem.Text & "' and qt.qotranid='" & ddlqo.SelectedItem.Text & "' ", myConnection6)
myConnection6.Open()
Dim myDataReader As SqlDataReader
myDataReader = cmd.ExecuteReader()
While (myDataReader.Read()) = True
pid = myDataReader("proid")
Dim ad As New SqlDataAdapter("SELECT q.productid,s.productid,s.serialno as serialno from stockserialno s,quotation q where q.qotranid='" & Trim(ddlqo.SelectedItem.Text) & "' and q.productid=s.productid and s.status='A' and s.productid='" & productid1.Text & "' ", myConnection3)
ad.Fill(ds1, "stockserialno")
End While
myDataReader.Close()
myConnection6.Close()
Return ds1
End Function
I have tried above code but it display all the items in every row,but I need to display only those items that coresponding to paricular row.how can i do that?
|
|
|
|
|
Hi, what are those field do you want to display?
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
Only serialno of the particular product
|
|
|
|
|
If we register our product with Microsoft, how much do we have to pay Microsoft?
|
|
|
|
|
A million dollars. Send it to me, I'll pass it on.
( Express editions are free )
|
|
|
|
|
Guess that is a great answer for sure.
|
|
|
|
|
Hi, millions of dollars? a lot of money. You can use express edition its totally free.
Hope this one can help.
Thanks
Hi, Please select Good Question if my answer are fit to your Question.
|
|
|
|
|
I'm using asp:GridView on a page that uses a Master Page, and I added a template field to grid so that I can pop up a window instead of taking them to a full page.
When I click on the link that should call the script to open the popup, I get the error "Microsoft JScript runtime error: Object expected", & I haven't really seen any good answers online yet.
I'm using this, pretty much as given @ this article: Popup window for the GridView[^] (slow traffic there so posting here)
If anyone could provide a corretive assessment(ie: HELP!!!), that'd be great!
My page source looks a bit like this:
<code>
<asp:Content ID="Content1" runat="server"
contentplaceholderid="MainContentPlaceHolder">
<script language="javascript">
var popupWindow
function openPopup(strOpen) {
popupWindow = window.open(strOpen, 'DaaaaName', 'width=500, height=700, top=100, left=300');
if (window.focus) popupWindow.focus();
}
</script>
<asp:GridView......>
.....
< Columns >
......
<asp:TemplateField HeaderText="Rate it?">
< ItemTemplate >
< a href="javascript:openPage('Ratings.aspx?ID=<%# Eval("ID") %>')">Rate it! </a >
< /ItemTemplate>
< /asp:TemplateField>
< /Columns>
......
< /asp:GridView>
< /asp:Content>
</code>
|
|
|
|
|
Hi, make sure after you close your popup you will alwys return a value to your page(gridview).
|
|
|
|
|
Hello,
If you mean I should return true; from my javascript function "openPopup", I've already tried that w/ no effect on the error msg I'm getting about "Object expected"
Thanks
|
|
|
|
|
hey,
I cant find any function openPage() defined in script.that is why, u r getting object expected error. may be u r trying to call openPopup() function.
Happy coding.....
|
|
|
|
|
well hell, if that's not what it is. I love it when I do that. Thank you sir for your extra pair of eyes, it works as expected now.
|
|
|
|
|
I am trying to add a repeater to a view (in multiview control) at runtime...
i coded as below
Repeater repeater = new Repeater();
//repeater control requires template
TemplateBuilder template = new TemplateBuilder();
//for proper alignment , i want to insert a table with cells
HtmlTable table = new HtmlTable();
HtmlTableRow row = new HtmlTableRow();
HtmlTableCell cell = new HtmlTableCell();
Label l = new Label();
l.Text = "Model";
cell.Controls.Add(l);
HtmlTableCell cell2 = new HtmlTableCell();
TextBox t = new TextBox();
t.Text = "ModelNumber";
cell2.Controls.Add(t);
row.Cells.Add(cell);
row.Cells.Add(cell2);
table.Rows.Add(row);
ControlBuilder c=new ControlBuilder();
template.InstantiateIn(table);
repeater.ItemTemplate = template;
viewModels.Controls.Add(repeater);
multiViewResult.SetActiveView(viewModels);
i have added this code to page_load,
The text that i am assigning is dummy here but i would be assingin string to it.. i did this to try if it works but it turns out that it works fine... it doesn't throw exceptions but still no data is displayed... can anyone help me with this problem
thanx
|
|
|
|
|
Hi,
I have a question, a kind of simple question but i don't know the exact answer so please help with providing one or 2 reasons...
i want to populate my asp.net page with data retrieved from database. i can bind the data in onloadcomplete method and can do the same in pageload method... Which of these two is preferred choice and why? i am gonna add controls at runtime... when should controls be added... plz provide help
thanx
|
|
|
|
|
Neither. PRerender is when you should read data from the db, so if any data is changed by an event, such as a button click, you read the data after the change.
|
|
|
|
|
wow...thanx... do you have any article on all these methods, coz i think i really need to learn about these methods... how about when one is dynamically attaching controls, where do we put that code...
I think i need to read such things but i've never read about such practices in any book or any article...
where can i find help
thanx
regards
|
|
|
|
|
dynamically added controls need to be added before page load, and need to be added every time the same, if you want them to have viewstate.
There's a great book which explained all of this really well, called Essential ASP.NEt with examples in C# ( there's a VB.Net version also )
|
|
|
|
|
I am trying to run my asp.net project for testing in my laptob and I use Kaspersky internet security. The project cannot be displayed as the internet explorer showed. Please if you have any idea that would be greate. Thanks
|
|
|
|
|
Did U try changing the tools option setting in Internet settings?
|
|
|
|
|
Thank you for replying, but how exactly should I do that?
hawari
|
|
|
|