|
Hi
I think there is no error in the SubString function, there is an error after scope function.
For searching multiple folders, syntax is given below:
<br />
SELECT "DAV:displayname"<br />
FROM <br />
SCOPE('shallow traversal of "http://myserver/public"',<br />
'shallow traversal of "http://myserver/public/userinfo"',<br />
'shallow traversal of "http://myserver/public/userinfo/phonenumber"')
Please check this site for more information:
http://msdn2.microsoft.com/en-us/library/aa579385(EXCHG.80).aspx[^]
When i debug your code, i got the following statement:
select Vpath, path, FileName, size, write, attrib, SUBSTRING(Characterization,90,DATALENGTH(Characterization)-1) as Characterization, DocTitle, rank from scope('shallow traversal of \"/Software\",\"/Industries\",\"/\"') where FREETEXT(contents,'abc') and FileName NOT LIKE 'inc_%' and FileName NOT LIKE '%.js' and FileName NOT LIKE 'searchresult.aspx' and FileName NOT LIKE '%.css' order by rank desc
which is different from the given syntax.
Hope this helps.
Harini
|
|
|
|
|
Hi Harini,
That SCOPE() function is working fine. Based on ur reply on yesterday only i solved that problem.
|
|
|
|
|
hi,
I have a menu in Default.aspx, based on the menu clicked corresponding user control is loaded dynamically using LoadControl(). This User control loaded has a formview control in which a dropdown and a textbox are present. When i set the autopost back property of the dropdown to true and select an item in it. The User control which is loaded is disappearing.
I have found that the page_load event of the Defualt.aspx is called.
I have used Ajax too..but it didn't help me. Can anyone help me ?
thanks,
deep.
modified on Friday, April 25, 2008 12:33 AM
|
|
|
|
|
Dynamically added controls are not regenerated when the page is posted back
If you are adding the controls in the pageload inside an ispostback condition, get it out of that condition, and let the controls be added each time the page is posted back
Alexei Rodriguez
|
|
|
|
|
Hi,
Then how can i maintain the state of the dropdown ? i.e if i select a particular value and load the control again.....the state of the drop is lost.... how can i fix this ?
Thanks,
deep.
|
|
|
|
|
Can you try to add your control in the Page_Init
Alexei Rodriguez
|
|
|
|
|
As AlexeiXX3 mentioned, dynamically generated controls are not recreated after the page postbacks.
The thing is that the postback resets the page to it's original state, so any information regarding the dynamically created controls is lost. Why is that? Because the Page class is stateless. The Page recreates child controls based on the tags in the aspx files, so your controls not being present there are not shown. What you need to do is recreate the controls in the OnInit event or any event that fires before PageLoad , or in PageLoad if you do a check to see is the page is posted back. See this article[^] as an example.
The thing to keep in mind is that when recreating the controls to assign them the same ID they previously had. This way you will retain the state of the controls. That's because when you postback a page the values of the controls are saved in the viewstate, but when state is restored to the controls, it actually looks for the controls with the coresponding ID's on the page. If it can find them it will restore them. So you don't have to worry about state as long as you recreate your controls correctly.
Cheers,
Mircea
"Pay people peanuts and you get monkeys" - David Ogilvy
|
|
|
|
|
Hi ,
I have added radio button dynamically during page loading.I have two questiions.
1) when I click radio button, have to call javascript function.
2) Get value of radio button(RadioButtonId.Value) when I click NextButton.
// Adding radio buttons Dynamically to panel control.
HtmlInputRadioButton rdb = new HtmlInputRadioButton();
for (int i = 0; i < dvForDisplay.Count; i++)
{
rdb.ID = dvForDisplay[i]["RadioButtonId"].ToString();
rdb.Value = dvForDisplay[i]["PaymentGateway"].ToString();
panelInternational.Controls.Add(rdb);
}
// Button click event
protected void btnNext_Click(object sender, EventArgs e)
{
here I want to get radion button value.
}
Can anybody help me..
Thanks
modified on Friday, April 25, 2008 12:18 AM
|
|
|
|
|
To get the value of the radiobutton, you need to add the controls to the panel again
Dinamically added controls are not regenerated when the page is posted back
If you are adding the controls in the pageload inside an ispostback condition, get it out of that condition, and let the controls be added each time the page os posted back
Alexei Rodriguez
|
|
|
|
|
Hi,
thanks for your reply. Can you tell me How to read controls from panel control?
HtmlInputRadioButton rdb = new HtmlInputRadioButton();
for (int i = 0; i < dvForDisplay.Count; i++)
{
rdb.ID = dvForDisplay[i]["RadioButtonId"].ToString();
rdb.Value = dvForDisplay[i]["PaymentGateway"].ToString();
panelInternational.Controls.Add(rdb);
}
Thanks
|
|
|
|
|
For Each ctrl As Control In panelInternational.Controls
If TypeOf ctrl Is RadioButton Then
Dim radio As RadioButton = CType(ctrl, RadioButton)
'Do what you want with radio variable wich has a control
End If
Next
In this example, im using radiobuttons and not htmlradiobuttons
If you are adding many radiobuttons to the panel i would recomend using a radiobuttonList (And add all the options you need to a single control)
Then to retrieve the selected value, Just use radiobuttonList.selectedValue
Alexei Rodriguez
|
|
|
|
|
Ok,
But I have to display image beside each radio button. Is it possible using Radiobutton list. please see the follwoing code.
HtmlInputRadioButton rdb = new HtmlInputRadioButton();
System.Web.UI.WebControls.Image imgasp = new System.Web.UI.WebControls.Image();
for (int i = 0; i < dvForDisplay.Count; i++)
{
rdb.ID = dvForDisplay[i]["RadioButtonId"].ToString();
rdb.Value = dvForDisplay[i]["PaymentGateway"].ToString();
panelInternational.Controls.Add(rdb);
panelInternational.Controls.Add(imgasp); // adding Image beside each radiio button
}
Thanks
|
|
|
|
|
Can you tell me how to validate on client side? If I click radio button have to call javascript function.
Thanks,
|
|
|
|
|
Im not sure if it is possible, maybe it is, just try it for yourself. After all, a radiobuttonlist is just a grouo of radiobuttons
If you use radiobuttonlist you can then add a single validator to this control and validate (on client side) that the users selects one
Alexei Rodriguez
|
|
|
|
|
I have a DetailsView where there is a DateTime field in an InsertItemTemplate. Im using a popup type calendar located in another aspx page. When a date is selected, the value populates a TextBox in the Parent window.
It works fine with any TextBox - but not the TextBox in the DetailsView. The error generates from the javascript function that tries to Return the Date to the TextBox in the DetailsView. Here's the code:
<br />
function ReturnDate()<br />
{<br />
window.opener.document.forms["<%= strFormName %>"].elements["<%= strCtrlName %>"].value = <br />
"<%= strSelectedDate %>";<br />
window.close();<br />
}<br />
The error is: window.opener.document.forms.form1.elements.txtStartDate is null or not an object.
Obviously its not recognizing the TextBox because it is in the DetailsView.
Anybody knows how to access the TextBox in the DetailsView from JavaScript?
|
|
|
|
|
The problem must be that the name you are using is not the same when the control is rendered on the page, since it is inside a detailsview
Have you tried the control's clientID??
<%= TextboxCtrl.ClientID %>
ClientID will return the complete name of the control
Alexei Rodriguez
modified on Friday, April 25, 2008 1:03 AM
|
|
|
|
|
I saw your other reply, DONT MAKE ANOTHER POST
Or was it an App Error here at codeproject?
Anyways
I didnt really understand what you said on that post, please clarify
Just to see if it works
0- Run your page and switch the detailsview to insert mode
1- Rightclick the page > select view source
2- Find the textbox control name in the html source
3- Copy the whole name and replace strCtrlName in you javascript function with that name
Alexei Rodriguez
|
|
|
|
|
Hi ALexei,
Yeah - I saw the viewsource is using a name like: DetailsViewID$TextBoxID.
I used id, and it works fine.
Thanks so much.
Ekjon
|
|
|
|
|
Maybe you should delete the other post
It makes no sense at all being there alone
Alexei Rodriguez
|
|
|
|
|
Hello to all!
I am passing a session variable (bookID) from Page 1 to Page 2 and I have it displaying as a label on Page 2. However, I am needing to display a gridview2 on the second page for books that have Book Reviews based on that bookID (the one i passed from Page 1 to Page 2). If I need to explain any further please ask I don't mind.
**Books**
bookID
bookName
**Book Review**
bookID
bookReview
bookReviewUser
I would like the gridview2 on page two, to have a column displaying book reviews just for that particular bookID (that was chosen on the gridview1 on page one..after the user clicks on the button in the gridview). Help is very much appreciated!! Thanks! 
|
|
|
|
|
Sure, why not.
Whether you are using a SqlDataSource, or DataReader or DataSet - use your bookID in the SQL statement, make this SQL the SelectCommand for your data source, associate the GridView with the data source, bind the data.
Thats it!
Hope it helps.
Ekjon
|
|
|
|
|
On the page2, get the book id from session and query database for getting the reviews and bind the result to the gridview. What is the problem you are facing here ?
|
|
|
|
|
Yes you can use session value
But why dont you use querystrings instead??
Alexei Rodriguez
|
|
|
|
|
How would I go about doing that? Thanks!
|
|
|
|
|
You either need to buy a book or use Google. That is a very basic question.
|
|
|
|